Implemented a basic translation.

This commit is contained in:
Pietro Gagliardi 2015-10-11 11:42:07 -04:00
parent 87680a6470
commit 3d8f8f0756
2 changed files with 7 additions and 1 deletions

View File

@ -406,7 +406,12 @@ static void drawD2DLinearBrush(uiAreaDrawParams *p)
uiDrawBrushGradientStop stops[2];
uiDrawStrokeParams sp;
// TODO transform by (25,25) to leave some room
uiDrawMatrix m;
// leave some room
uiDrawMatrixSetIdentity(&m);
uiDrawMatrixTranslate(&m, 25, 25);
uiDrawTransform(p->Context, &m);
gradient.Type = uiDrawBrushTypeLinearGradient;
gradient.X0 = 0;

View File

@ -178,6 +178,7 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr)
dp.HScrollPos = gtk_adjustment_get_value(ap->ha);
dp.VScrollPos = gtk_adjustment_get_value(ap->va);
// no need to save or restore the graphics state; GTK+ does that for us
(*(ap->ah->Draw))(ap->ah, ap->a, &dp);
freeContext(dp.Context);