mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 05:14:45 +00:00
Added SkinneableTheme::apply_gui_scale() member function.
This commit is contained in:
parent
2d3cfe116b
commit
dc19778ecc
@ -26,6 +26,7 @@
|
||||
#include "loadpng.h"
|
||||
#include "ase_exception.h"
|
||||
#include "modules/skinneable_theme.h"
|
||||
#include "modules/gui.h"
|
||||
|
||||
#define CHARACTER_LENGTH(f, c) ((f)->vtable->char_length((f), (c)))
|
||||
|
||||
@ -1621,6 +1622,24 @@ void SkinneableTheme::less_bevel(int *bevel)
|
||||
if (bevel[3] > 0) --bevel[3];
|
||||
}
|
||||
|
||||
BITMAP* SkinneableTheme::apply_gui_scale(BITMAP* original)
|
||||
{
|
||||
int scale = guiscale();
|
||||
if (scale > 1) {
|
||||
BITMAP* scaled = create_bitmap(original->w*scale,
|
||||
original->h*scale);
|
||||
|
||||
for (int y=0; y<scaled->h; ++y)
|
||||
for (int x=0; x<scaled->w; ++x)
|
||||
putpixel(scaled, x, y, getpixel(original, x/scale, y/scale));
|
||||
|
||||
destroy_bitmap(original);
|
||||
return scaled;
|
||||
}
|
||||
else
|
||||
return original;
|
||||
}
|
||||
|
||||
/* controls the "X" button in a window to close it */
|
||||
bool SkinneableTheme::theme_frame_button_msg_proc(JWidget widget, JMessage msg)
|
||||
{
|
||||
|
@ -386,6 +386,7 @@ private:
|
||||
void draw_entry_cursor(JWidget widget, int x, int y);
|
||||
void draw_bevel_box(int x1, int y1, int x2, int y2, int c1, int c2, int *bevel);
|
||||
void less_bevel(int *bevel);
|
||||
BITMAP* apply_gui_scale(BITMAP* original);
|
||||
|
||||
static bool theme_frame_button_msg_proc(JWidget widget, JMessage msg);
|
||||
static bool theme_combobox_button_msg_proc(JWidget widget, JMessage msg);
|
||||
|
Loading…
Reference in New Issue
Block a user