Community
Participate
Working Groups
+++ This bug was initially created as a clone of Bug #313315 +++ Build Identifier: I20100312-1448 Guide markers are only half visible on Cocoa - they extend below the bottom/right edge of the ruler. Issue is due to the following method not taking Cocoa into account when detecting Mac OS X: > private static Rectangle calculateRulerTrim(Canvas canvas) { > if ("carbon".equals(SWT.getPlatform())) { //$NON-NLS-1$ Will supply a patch changing the offending line to: > if (Platform.OS_MACOSX.equals(Platform.getOS())) { Reproducible: Always Steps to Reproduce: 1. Open a GEF editor with a ruler on Cocoa 2. Click in the ruler area to create a guide 3. Observe that the guide is only partly visible
(In reply to comment #6) > It turns out that in the GuideFigure drawing code, where it draws the 'V' or > '>' part of the guide (depending on whether vertical/horizontal) it is using > drawLine() to draw each point - these calls are not actually drawing anything > on Cocoa where P1 = P2. > Alternatively another SWT bug needs to be raised as to why > o.e.swt.graphics.GC.drawLine(x,y, x,y) draws nothing under Cocoa. Carbon had this bug as well, and the fix never propagated to Cocoa. This should do it: ### Eclipse Workspace Patch 1.0 #P org.eclipse.swt Index: Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java,v retrieving revision 1.78 diff -u -r1.78 GC.java --- Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java 7 May 2010 19:40:38 -0000 1.78 +++ Eclipse SWT/cocoa/org/eclipse/swt/graphics/GC.java 24 May 2010 22:17:00 -0000 @@ -1147,6 +1147,10 @@ */ public void drawLine(int x1, int y1, int x2, int y2) { if (handle == null) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); + if (x1 == x2 && y1 == y2 && data.lineWidth <= 1) { + drawPoint(x1, y1); + return; + } NSAutoreleasePool pool = checkGC(DRAW); try { NSBezierPath path = data.path;
No rush yet on the review; just tracking for 3.6.2.
Fixed in R3_6_maintenance branch > 20101103.