Compare commits

..

No commits in common. "fa7b1631f0a0ca911ad9a0aa41278f389f2b45eb" and "cc29f80bb2246eb0057030627586d0b2c4d26371" have entirely different histories.

View File

@ -129,17 +129,14 @@ fastiv_view_draw(GtkWidget *widget, cairo_t *cr)
double x = 0; double x = 0;
double y = 0; double y = 0;
if (w < allocation.width) if (w < allocation.width)
x = round((allocation.width - w) / 2.); x = (allocation.width - w) / 2;
if (h < allocation.height) if (h < allocation.height)
y = round((allocation.height - h) / 2.); y = (allocation.height - h) / 2;
cairo_scale(cr, self->scale, self->scale); cairo_scale(cr, self->scale, self->scale);
cairo_set_source_surface(cr, self->surface, cairo_set_source_surface(cr, self->surface,
x / self->scale, y / self->scale); x / self->scale, y / self->scale);
// TODO(p): Prescale it ourselves to an off-screen bitmap, gamma-correctly.
cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_GOOD);
cairo_paint(cr); cairo_paint(cr);
return TRUE; return TRUE;
} }