menu view: position widgets initially at (0, 0)

The default 'Rect' constructor constructs an invalid rectangle where the
p1 coordinates are lower than the p2 coordinates. In particular, p1 is
set to (1, 1). The 'Widget' implementation uses the points individually
as input into the 'Animated_rect' mechanism. This way, widgets end up
being positioned at (1, 1) initially and are moved to (0, 0) once the
first layout update is applied. By explicitly initializing the
'_geometry' to (0x0+0+0), we avoid this initial artifact.
This commit is contained in:
Norman Feske 2019-03-09 15:38:43 +01:00 committed by Christian Helmuth
parent f4542b378c
commit b00e1f4e4b
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class Menu_view::Widget : List_model<Widget>::Element
* Position relative to the parent widget and actual size, defined by
* the parent
*/
Rect _geometry { };
Rect _geometry { Point(0, 0), Area(0, 0) };
Animated_rect _animated_geometry { _factory.animator };