Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 71480 Details for
Bug 185966
[linked mode] Consider making dashed line for linked mode master the default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
add no-dash-zone to corners
185966_patch.txt (text/plain), 3.19 KB, created by
Markus Keller
on 2007-06-15 12:06:50 EDT
(
hide
)
Description:
add no-dash-zone to corners
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2007-06-15 12:06:50 EDT
Size:
3.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench.texteditor >Index: src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java,v >retrieving revision 1.42 >diff -u -r1.42 SourceViewerDecorationSupport.java >--- src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java 9 May 2007 07:28:42 -0000 1.42 >+++ src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java 15 Jun 2007 16:05:18 -0000 >@@ -161,27 +161,67 @@ > * @since 3.3 > */ > private static final class DashedBoxDrawingStrategy extends BoxDrawingStrategy { >+ private int evenSteps(int len, int s) { >+ int twoS= 2 * s; >+ return (len) / twoS * twoS; >+ } >+ > /* > * @see org.eclipse.ui.texteditor.SourceViewerDecorationSupport.BoxDrawingStrategy#drawBox(org.eclipse.swt.graphics.GC, org.eclipse.swt.graphics.Color, org.eclipse.swt.graphics.Rectangle) > */ > protected void drawBox(GC gc, StyledText textWidget, Color color, Rectangle bounds) { >- //clean bg: >- gc.setForeground(textWidget.getBackground()); >- gc.setLineStyle(SWT.LINE_SOLID); >+ gc.setForeground(color); > int x= bounds.x; > int y= bounds.y; > int w= bounds.width - 1; > int h= bounds.height - 1; > gc.drawRectangle(x, y, w, h); > >- gc.setForeground(color); >- gc.setLineDash(new int[] { 3 }); >+ gc.setForeground(textWidget.getBackground()); >+ >+//dash from left & adjust right: >+ int d= 3; //dash length >+ int c= 4; //no-dash-zone at corners >+ gc.setLineDash(new int[] { d }); >+ if (w > 2 * c) { >+ int w2= evenSteps(w - 2 * c, d) + d - 1; >+ gc.drawLine(x + c, y, x + c + w2, y); >+ gc.drawLine(x + c, y + h, x + c + w2, y + h); >+ } >+ if (h > 2 * c) { >+ int h2= evenSteps(h - 2 * c, d) + d - 1; >+ gc.drawLine(x, y + c, x, y + c + h2); >+ gc.drawLine(x + w, y + c, x + w, y + c + h2); >+ } >+ >+////dash from left & right (partial dashes at center): >+// int d= 3; >+// int o= 6; >+// gc.setLineDash(new int[] { d }); >+// if (w > 2 * o) { >+// gc.drawLine(x + o, y, x + w/2, y); >+// gc.drawLine(x + w - o, y, x + w/2, y); >+// >+// gc.drawLine(x + o, y + h, x + w/2, y + h); >+// gc.drawLine(x + w - o, y + h, x + w/2, y + h); >+// } >+// if (h > 2 * o) { >+// gc.drawLine(x, y + o, x, y + h - o); >+// gc.drawLine(x + w, y + o, x + w, y + h - o); >+// } > >- // gc.drawRectangle(x, y, w, h) is platform-dependent and can look "animated" >- gc.drawLine(x, y, x + w, y); >- gc.drawLine(x, y + h, x + w, y + h); >- gc.drawLine(x, y, x, y + h); >- gc.drawLine(x + w, y, x + w, y + h); >+////dash from left (partial dashes at right): >+// int d= 6; >+// int o= 6; >+// gc.setLineDash(new int[] { d }); >+// if (w > 2 * o) { >+// gc.drawLine(x + o, y, x + w - o, y); >+// gc.drawLine(x + o, y + h, x + w - o, y + h); >+// } >+// if (h > 2 * o) { >+// gc.drawLine(x, y + o, x, y + h - o); >+// gc.drawLine(x + w, y + o, x + w, y + h - o); >+// } > > //RESET (same GC is passed around!): > gc.setLineStyle(SWT.LINE_SOLID);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 185966
:
71442
|
71477
|
71480