fredsa / gwt-dnd

Library providing easy to use mouse or touch based drag-and-drop capabilities to GWT
43 stars 41 forks source link

RTL issues in FlowPanelDropController and other panels extending AbstractIndexedDropController #168

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try drag-n-drop on FlowPanelDropController for a RTL language (eg. arabic)

What is the expected output? What do you see instead?
Expected: Positioner should be inserted around the location of the cursor.
Actual: Position is getting added in wrong index on the flow panel.

Please use labels and text to provide additional information.
Root cause: The calculations for the target index for the positioner (done in 
DOMUtil#findIntersect) does not work for RTL languages. Specifically lines 
142-148 need to be updated to:
      ...
      } else if (midArea.getRight() < location.getLeft()) {
        debugWidgetWithColor(parent, mid, "blue");
        if (isRtl()) {
          high = mid;
        } else {
          low = mid;
        }
      } else if (midArea.getLeft() > location.getLeft()) {
        debugWidgetWithColor(parent, mid, "red");
        if (isRtl()) {
          low = mid;
        } else {
          high = mid;
        }
      } else {
      .... 

Original issue reported on code.google.com by yami...@google.com on 9 Apr 2013 at 9:00

GoogleCodeExporter commented 9 years ago
Thanks! Committed with some adjustments as 
7f81787b8a545a95fd4326e3305d805b82609775

http://gwt-dnd.appspot.com/#InsertPanelExample - works in rtl mode
http://gwt-dnd.appspot.com/#FlowPanelExample - still needs some work

Original comment by fredsa on 10 Apr 2013 at 4:45

GoogleCodeExporter commented 9 years ago
Additional fix in 625d40ffc9b6c781579bf95607a4e2cf111adc61

This appears to fix rtl support for http://gwt-dnd.appspot.com/#FlowPanelExample

Original comment by fredsa@google.com on 10 Apr 2013 at 10:59