summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-05-31 17:52:09 +0200
committerDave Davenport <qball@gmpclient.org>2017-05-31 17:52:09 +0200
commit4e3830a519877ca6b016befa3ae04d209ebdb000 (patch)
treeafd719eeaafbb9a83da9e27b252ce392b6b31c97 /source
parent939495f00bb37cdd2edd7d3f8398b6ff472e82c4 (diff)
[TextBox] Fix icon alignment issue when scaling icon.
Diffstat (limited to 'source')
-rw-r--r--source/widgets/textbox.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c
index 0a0af9d8..27bc5246 100644
--- a/source/widgets/textbox.c
+++ b/source/widgets/textbox.c
@@ -380,16 +380,15 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
// draw Icon
if ( (tb->flags&TB_ICON) == TB_ICON && tb->icon != NULL ) {
int iconheight = textbox_get_font_height ( tb );
- int translatex = 0;
cairo_save(draw);
/*int iconw = cairo_image_surface_get_width (tb->icon);*/
int iconh = cairo_image_surface_get_height (tb->icon);
double scale = (double)iconheight / iconh;
- cairo_translate(draw, translatex, 0);
+ cairo_translate(draw, x, y);
cairo_scale(draw, scale, scale);
- cairo_set_source_surface(draw, tb->icon, x, y);
+ cairo_set_source_surface(draw, tb->icon, 0,0);
cairo_paint(draw);
cairo_restore(draw);
}