Cosmetics
This commit is contained in:
+8
-6
@@ -491,13 +491,15 @@ class BitmapBuffer: public BitmapBufferBase<pixel_t>
|
||||
template<class T>
|
||||
void drawScaledBitmap(const T * bitmap, coord_t x, coord_t y, coord_t w, coord_t h)
|
||||
{
|
||||
float vscale = float(h) / bitmap->height();
|
||||
float hscale = float(w) / bitmap->width();
|
||||
float scale = vscale < hscale ? vscale : hscale;
|
||||
if (bitmap) {
|
||||
float vscale = float(h) / bitmap->height();
|
||||
float hscale = float(w) / bitmap->width();
|
||||
float scale = vscale < hscale ? vscale : hscale;
|
||||
|
||||
int xshift = (w - (bitmap->width() * scale)) / 2;
|
||||
int yshift = (h - (bitmap->height() * scale)) / 2;
|
||||
drawBitmap(x + xshift, y + yshift, bitmap, 0, 0, 0, 0, scale);
|
||||
int xshift = (w - (bitmap->width() * scale)) / 2;
|
||||
int yshift = (h - (bitmap->height() * scale)) / 2;
|
||||
drawBitmap(x + xshift, y + yshift, bitmap, 0, 0, 0, 0, scale);
|
||||
}
|
||||
}
|
||||
|
||||
BitmapBuffer * horizontalFlip() const;
|
||||
|
||||
+3
-4
@@ -33,6 +33,8 @@ class CarouselItem {
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~CarouselItem() = default;
|
||||
|
||||
public:
|
||||
Window * front;
|
||||
Window * back;
|
||||
@@ -49,10 +51,7 @@ class CarouselWindow: public Window {
|
||||
|
||||
~CarouselWindow() override
|
||||
{
|
||||
for (auto & item: items) {
|
||||
item->front->deleteLater();
|
||||
item->back->deleteLater();
|
||||
}
|
||||
clear();
|
||||
}
|
||||
|
||||
void addItem(CarouselItem * item)
|
||||
|
||||
Reference in New Issue
Block a user