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 123955 Details for
Bug 79542
A bug in Thumbnail.ThumbnailUpdater
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]
Thumbnails updater now checks to see whether the source figure is moving before it tries to repaint it
patch79542.txt (text/plain), 2.89 KB, created by
Brendan Curran-Johnson
on 2009-01-27 16:56:05 EST
(
hide
)
Description:
Thumbnails updater now checks to see whether the source figure is moving before it tries to repaint it
Filename:
MIME Type:
Creator:
Brendan Curran-Johnson
Created:
2009-01-27 16:56:05 EST
Size:
2.89 KB
patch
obsolete
>Index: src/org/eclipse/draw2d/parts/Thumbnail.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.draw2d/src/org/eclipse/draw2d/parts/Thumbnail.java,v >retrieving revision 1.31 >diff -u -r1.31 Thumbnail.java >--- src/org/eclipse/draw2d/parts/Thumbnail.java 18 Apr 2006 18:08:55 -0000 1.31 >+++ src/org/eclipse/draw2d/parts/Thumbnail.java 27 Jan 2009 21:36:58 -0000 >@@ -26,6 +26,7 @@ > import org.eclipse.draw2d.ScaledGraphics; > import org.eclipse.draw2d.UpdateListener; > import org.eclipse.draw2d.geometry.Dimension; >+import org.eclipse.draw2d.geometry.Point; > import org.eclipse.draw2d.geometry.Rectangle; > > /** >@@ -39,7 +40,11 @@ > extends Figure > implements UpdateListener > { >- >+ /** >+ * keeps track of the location of the source Rectangle. It is used so that >+ * the Thumbnail is only redrawn on an actual change not on a scroll >+ */ >+ private Point oldSourceRectLoc = null; > /** > * This updates the Thumbnail by breaking the thumbnail {@link Image} into > * several tiles and updating each tile individually. >@@ -229,7 +234,12 @@ > sourceFigure.isMirrored() ? SWT.RIGHT_TO_LEFT : SWT.NONE); > thumbnailGraphics = new ScaledGraphics(new SWTGraphics(thumbnailGC)); > thumbnailGraphics.scale(getScaleX()); >- thumbnailGraphics.translate(getSourceRectangle().getLocation().negate()); >+ >+ /** >+ * this value is used to check whether the figure has been scrolled >+ */ >+ oldSourceRectLoc = getSourceRectangle().getLocation(); >+ thumbnailGraphics.translate(oldSourceRectLoc.negate()); > > Color color = sourceFigure.getForegroundColor(); > if (color != null) >@@ -433,18 +443,29 @@ > * @see org.eclipse.draw2d.UpdateListener#notifyPainting(Rectangle, Map) > */ > public void notifyPainting(Rectangle damage, Map dirtyRegions) { >- Iterator dirtyFigures = dirtyRegions.keySet().iterator(); >- while (dirtyFigures.hasNext()) { >- IFigure current = (IFigure)dirtyFigures.next(); >- while (current != null) { >- if (current == getSource()) { >- setDirty(true); >- repaint(); >- return; >+ /** >+ * The method first checks to see whether the Figure is being moved. >+ * If it is, it updates the stored location of the Figure. If notifyPainting >+ * has been called for a reason other than a scroll movement, it repaints >+ */ >+ Point sourceRectLoc = getSourceRectangle().getLocation(); >+ if (oldSourceRectLoc==null||oldSourceRectLoc.equals(sourceRectLoc)) >+ { >+ Iterator dirtyFigures = dirtyRegions.keySet().iterator(); >+ while (dirtyFigures.hasNext()) { >+ IFigure current = (IFigure)dirtyFigures.next(); >+ while (current != null) { >+ if (current == getSource()) { >+ setDirty(true); >+ repaint(); >+ return; >+ } >+ current = current.getParent(); > } >- current = current.getParent(); > } > } >+ else >+ oldSourceRectLoc = sourceRectLoc; > } > > /**
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 79542
:
16160
|
16161
|
83071
| 123955