Skip to content

Commit 82b8815

Browse files
author
soheil_h_y
committed
1. Relative coordination in an scrolled composite must be computed according to the scroll coordination
1 parent eac4c23 commit 82b8815

File tree

2 files changed

+4
-4
lines changed
  • sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal

2 files changed

+4
-4
lines changed

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal/browser/OS.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,8 @@ public static Point calcuateRelativePosition(Element el, Element relativeEl){
434434
int left = 0;
435435
int top = 0;
436436
while (el != null && el != relativeEl) {
437-
left += el.offsetLeft;
438-
top += el.offsetTop;
437+
left += el.offsetLeft - el.scrollLeft ;
438+
top += el.offsetTop - el.scrollTop;
439439
if (el != srcEl)
440440
/**
441441
* @j2sNative

sources/net.sf.j2s.java.org.eclipse.swt/src/org/eclipse/swt/internal/xhtml/Element.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ public class Element {
6565

6666
public int height;
6767

68-
public int offsetWidth, clientWidth, scrollWidth;
68+
public int offsetWidth, clientWidth, scrollWidth, scrollLeft;
6969

70-
public int offsetHeight, clientHeight, scrollHeight;
70+
public int offsetHeight, clientHeight, scrollHeight, scrollTop;
7171

7272
public String src;
7373

0 commit comments

Comments
 (0)