clutter/stage: Don't loose precision when setting up viewport

We always hit non-fractional floats here because the stage views are
always made so that they are aligned on integer positions with integer
sizes, but there is no reason to go float -> int -> float when
calculating the viewport.

https://bugzilla.gnome.org/show_bug.cgi?id=765011
This commit is contained in:
Jonas Ådahl 2017-06-08 10:05:05 +08:00
parent 67eb289a6a
commit 0adc56779f

View File

@ -1446,8 +1446,8 @@ _clutter_stage_do_pick_on_view (ClutterStage *stage,
gint read_y; gint read_y;
float fb_width, fb_height; float fb_width, fb_height;
float fb_scale; float fb_scale;
int viewport_offset_x; float viewport_offset_x;
int viewport_offset_y; float viewport_offset_y;
priv = stage->priv; priv = stage->priv;
@ -3623,8 +3623,8 @@ _clutter_stage_maybe_setup_viewport (ClutterStage *stage,
cairo_rectangle_int_t view_layout; cairo_rectangle_int_t view_layout;
ClutterPerspective perspective; ClutterPerspective perspective;
float fb_scale; float fb_scale;
int viewport_offset_x; float viewport_offset_x;
int viewport_offset_y; float viewport_offset_y;
float z_2d; float z_2d;
CLUTTER_NOTE (PAINT, CLUTTER_NOTE (PAINT,