From b00e1f4e4b28689311d245a6257fee3a71e70e93 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sat, 9 Mar 2019 15:38:43 +0100 Subject: [PATCH] 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. --- repos/gems/src/app/menu_view/widget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/gems/src/app/menu_view/widget.h b/repos/gems/src/app/menu_view/widget.h index 5bb3d7b108..f4cb42e3a6 100644 --- a/repos/gems/src/app/menu_view/widget.h +++ b/repos/gems/src/app/menu_view/widget.h @@ -155,7 +155,7 @@ class Menu_view::Widget : List_model::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 };