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 138781 Details for
Bug 278923
Truncation problem in diagrams
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for head
org.eclipse.gmf.runtime.draw2d.ui.patch (text/plain), 2.99 KB, created by
Mariot Chauvin
on 2009-06-10 08:05:28 EDT
(
hide
)
Description:
patch for head
Filename:
MIME Type:
Creator:
Mariot Chauvin
Created:
2009-06-10 08:05:28 EDT
Size:
2.99 KB
patch
obsolete
>Index: src/org/eclipse/gmf/runtime/draw2d/ui/text/TextUtilitiesEx.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.draw2d.ui/src/org/eclipse/gmf/runtime/draw2d/ui/text/TextUtilitiesEx.java,v >retrieving revision 1.2 >diff -u -r1.2 TextUtilitiesEx.java >--- src/org/eclipse/gmf/runtime/draw2d/ui/text/TextUtilitiesEx.java 13 Nov 2008 17:12:30 -0000 1.2 >+++ src/org/eclipse/gmf/runtime/draw2d/ui/text/TextUtilitiesEx.java 10 Jun 2009 10:29:15 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2007, 2008 IBM Corporation and others. >+ * Copyright (c) 2007, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -14,7 +14,6 @@ > import org.eclipse.draw2d.TextUtilities; > import org.eclipse.draw2d.geometry.Dimension; > import org.eclipse.gmf.runtime.draw2d.ui.mapmode.IMapMode; >-import org.eclipse.swt.SWT; > import org.eclipse.swt.graphics.Font; > import org.eclipse.swt.graphics.GC; > import org.eclipse.swt.widgets.Shell; >@@ -64,7 +63,7 @@ > */ > public Dimension getStringExtents(String s, Font f) { > Dimension extents = new Dimension(getStringDimension(s, f, true)); >- applyItalicBugHack(s, f, extents); >+ applyMarginAddition(s, f, extents); > applyMapModeConversion(extents); > return extents; > } >@@ -74,7 +73,7 @@ > */ > public Dimension getTextExtents(String s, Font f) { > Dimension extents = new Dimension(getTextDimension(s, f, true)); >- applyItalicBugHack(s, f, extents); >+ applyMarginAddition(s, f, extents); > applyMapModeConversion(extents); > return extents; > } >@@ -115,22 +114,19 @@ > } > > /** >- * If the font is in italics, this does not always return the correct >+ * {GC#textExtents(String s)} and {GC#stringExtent(String s)} do not always return the correct > * size and the text can get clipped. See > * https://bugs.eclipse.org/bugs/show_bug.cgi?id=5190. Compensate for >- * this here until the bugzilla is fixed in SWT by adding an extra half >- * a character space here. >- * >- * @deprecated >+ * by adding an extra character space here. >+ * @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=278923 > * @param s the string > * @param f the font > * @param dimension the extents to be corrected > */ >- private static void applyItalicBugHack(String s, Font f, Dimension extents) >+ private static void applyMarginAddition(String s, Font f, Dimension extents) > { >- if ((f.getFontData()[0].getStyle() & SWT.ITALIC) != 0 && >- s.length() > 0) { >- extents.width += (extents.width / s.length()) / 2; >+ if (s.length() > 0) { >+ extents.width += extents.width / s.length(); > } > } >
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 278923
:
138147
|
138148
| 138781 |
148530
|
148531
|
148614
|
168745
|
168747
|
211582
|
211583