After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 706450 - box-layout: Fix RTL layout swapping with non-zero container offsets
box-layout: Fix RTL layout swapping with non-zero container offsets
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
: 706449 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-08-20 23:09 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-08-21 14:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
box-layout: Fix RTL layout swapping with non-zero container offsets (1.08 KB, patch)
2013-08-20 23:09 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-08-20 23:09:35 UTC
See patch. Fixes RTL regressions in gnome-shell.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-08-20 23:09:37 UTC
Created attachment 252494 [details] [review]
box-layout: Fix RTL layout swapping with non-zero container offsets
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-08-20 23:10:01 UTC
*** Bug 706449 has been marked as a duplicate of this bug. ***
Comment 3 Emmanuele Bassi (:ebassi) 2013-08-21 14:02:06 UTC
Review of attachment 252494 [details] [review]:

::: clutter/clutter-box-layout.c
@@ +1218,3 @@
               gfloat width = child_allocation.x2 - child_allocation.x1;
 
+              child_allocation.x1 = box->x1 + (box->x2 - child_allocation.x1 - width);

shouldn't this be (box.x2 + child_allocation.x1 - width)?
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-08-21 14:09:25 UTC
I don't see how that would be correct. If we have a parent box spanning from 200-500, let's say, and we allocate a child spanning 50-150 through the above logic, then this condition needs to swap it around so the child is allocated spanning 350-450 (50 on the left becomes 500-50 on the right, and then the width is taken from that to make 350):

  200 + (500 - 50 - 100) = 350

It might make sense to do x2 first, and then we fill in x1 by subtracting the width instead, so it becomes:

  child_allocation.x2 = box->x1 + (box->x2 - child_allocation.x1);
  child_allocation.x1 = child_allocation.x2 - width;

Which might be a bit more obvious
Comment 5 Emmanuele Bassi (:ebassi) 2013-08-21 14:10:52 UTC
I do prefer obvious to clever, so the second form looks better to me.

feel free to commit that.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-08-21 14:14:20 UTC
Attachment 252494 [details] pushed as 05f56af - box-layout: Fix RTL layout swapping with non-zero container offsets


Pushed with suggested changes.