mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Removed app_get_fg/bg_color() functions.
This commit is contained in:
parent
c908af4b87
commit
07970e8116
22
src/app.cpp
22
src/app.cpp
@ -443,28 +443,6 @@ void app_default_statusbar_message()
|
||||
->setStatusText(250, "%s %s | %s", PACKAGE, VERSION, COPYRIGHT);
|
||||
}
|
||||
|
||||
int app_get_fg_color(Sprite *sprite)
|
||||
{
|
||||
color_t c = colorbar->getFgColor();
|
||||
assert(sprite != NULL);
|
||||
|
||||
if (sprite->getCurrentLayer() != NULL)
|
||||
return get_color_for_layer(sprite->getCurrentLayer(), c);
|
||||
else
|
||||
return get_color_for_image(sprite->getImgType(), c);
|
||||
}
|
||||
|
||||
int app_get_bg_color(Sprite *sprite)
|
||||
{
|
||||
color_t c = colorbar->getBgColor();
|
||||
assert(sprite != NULL);
|
||||
|
||||
if (sprite->getCurrentLayer() != NULL)
|
||||
return get_color_for_layer(sprite->getCurrentLayer(), c);
|
||||
else
|
||||
return get_color_for_image(sprite->getImgType(), c);
|
||||
}
|
||||
|
||||
int app_get_color_to_clear_layer(Layer *layer)
|
||||
{
|
||||
/* all transparent layers are cleared with the mask color */
|
||||
|
@ -77,8 +77,6 @@ Widget* app_get_tabsbar();
|
||||
|
||||
void app_default_statusbar_message();
|
||||
|
||||
int app_get_fg_color(Sprite* sprite);
|
||||
int app_get_bg_color(Sprite* sprite);
|
||||
int app_get_color_to_clear_layer(Layer* layer);
|
||||
|
||||
#endif
|
||||
|
@ -91,6 +91,8 @@ static void cleanpixel(BITMAP *bmp, int x, int y, int color);
|
||||
|
||||
static int point_inside_region(int x, int y, JRegion region);
|
||||
|
||||
static int get_pen_color(Sprite *sprite);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// CURSOR COLOR
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -269,7 +271,7 @@ void Editor::editor_draw_cursor(int x, int y, bool refresh)
|
||||
->getSettings()
|
||||
->getToolSettings(current_tool);
|
||||
|
||||
int pen_color = app_get_fg_color(m_sprite);
|
||||
int pen_color = get_pen_color(m_sprite);
|
||||
int new_mask_color;
|
||||
Pen* pen = editor_get_current_pen();
|
||||
|
||||
@ -658,3 +660,18 @@ static int point_inside_region(int x, int y, JRegion region)
|
||||
struct jrect box;
|
||||
return jregion_point_in(region, x, y, &box);
|
||||
}
|
||||
|
||||
static int get_pen_color(Sprite *sprite)
|
||||
{
|
||||
color_t c = UIContext::instance()->getSettings()->getFgColor();
|
||||
assert(sprite != NULL);
|
||||
|
||||
// Avoid using invalid colors
|
||||
if (!color_is_valid(c))
|
||||
return 0;
|
||||
|
||||
if (sprite->getCurrentLayer() != NULL)
|
||||
return get_color_for_layer(sprite->getCurrentLayer(), c);
|
||||
else
|
||||
return get_color_for_image(sprite->getImgType(), c);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user