layout: allow stretching the layout by a small amount

Due to the way the panel size is calculated, there might be a small
empty space on the sides or top of the layout. This can be an issue,
especially when this empty space is located on the sides, as touch
events in this area are not taken into account.

By allowing a small difference in horizontal and vertical scaling, we
can ensure the panel occupies the whole display width in cases where
this would be problematic.
This commit is contained in:
Arnaud Ferraris
2022-04-08 17:33:05 +02:00
committed by Arnaud Ferraris
parent 323fd7ea14
commit 68087a125c
4 changed files with 84 additions and 18 deletions

View File

@ -418,7 +418,8 @@ eek_gtk_keyboard_new (EekboardContextService *eekservice,
.widget_to_layout = {
.origin_x = 0,
.origin_y = 0,
.scale = 1,
.scale_x = 1,
.scale_y = 1,
},
};
priv->render_geometry = initial_geometry;

View File

@ -219,7 +219,7 @@ eek_renderer_render_keyboard (EekRenderer *self,
cairo_save(cr);
cairo_translate (cr, geometry.widget_to_layout.origin_x, geometry.widget_to_layout.origin_y);
cairo_scale (cr, geometry.widget_to_layout.scale, geometry.widget_to_layout.scale);
cairo_scale (cr, geometry.widget_to_layout.scale_x, geometry.widget_to_layout.scale_y);
squeek_draw_layout_base_view(keyboard->layout, self, cr);
squeek_layout_draw_all_changed(keyboard->layout, self, cr, submission);

View File

@ -87,7 +87,8 @@ void eek_bounds_free (EekBounds *bounds);
struct transformation {
gdouble origin_x;
gdouble origin_y;
gdouble scale;
gdouble scale_x;
gdouble scale_y;
};
G_END_DECLS