forked from AuroraMiddleware/gtk
scaler: Use new snapshot transforms
This commit is contained in:
parent
a881cbff3a
commit
f59f4d774b
@ -44,22 +44,16 @@ gtk_scaler_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
{
|
{
|
||||||
GtkScaler *self = GTK_SCALER (paintable);
|
GtkScaler *self = GTK_SCALER (paintable);
|
||||||
|
|
||||||
if (self->scale_factor == 1.0)
|
gtk_snapshot_save (snapshot);
|
||||||
{
|
|
||||||
gdk_paintable_snapshot (self->paintable, snapshot, width, height);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
graphene_matrix_t scale_matrix;
|
|
||||||
|
|
||||||
graphene_matrix_init_scale (&scale_matrix, 1.0 / self->scale_factor, 1.0 / self->scale_factor, 1.0);
|
gtk_snapshot_scale (snapshot, 1.0 / self->scale_factor, 1.0 / self->scale_factor);
|
||||||
gtk_snapshot_push_transform (snapshot, &scale_matrix);
|
|
||||||
gdk_paintable_snapshot (self->paintable,
|
gdk_paintable_snapshot (self->paintable,
|
||||||
snapshot,
|
snapshot,
|
||||||
width * self->scale_factor,
|
width * self->scale_factor,
|
||||||
height * self->scale_factor);
|
height * self->scale_factor);
|
||||||
gtk_snapshot_pop (snapshot);
|
|
||||||
}
|
gtk_snapshot_restore (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkPaintable *
|
static GdkPaintable *
|
||||||
|
Loading…
Reference in New Issue
Block a user