Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
index 34cdcaaabb4..50a257aa4c1 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java
@@ -588,6 +588,11 @@ public final class RevisionPainter {
* @since 3.3
*/
private int fLastWidth= -1;
+ /**
+ * The zoom level for the current painting operation. Workaround for bug 516293.
+ * @since 3.12
+ */
+ private int fZoom= 100;
/**
* Creates a new revision painter for a vertical ruler column.
@@ -658,6 +663,20 @@ public final class RevisionPainter {
}
/**
+ * Sets the zoom level for the current painting operation. Workaround for bug 516293.
+ *
+ * @param zoom the zoom to set
+ * @since 3.12
+ */
+ public void setZoom(int zoom) {
+ fZoom= zoom;
+ }
+
+ private int autoScaleUp(int value) {
+ return value * fZoom / 100;
+ }
+
+ /**
* Delegates the painting of the quick diff colors to this painter. The painter will draw the
* color boxes onto the passed {@link GC} for all model (document) lines in
* <code>visibleModelLines</code>.
@@ -1058,7 +1077,7 @@ public final class RevisionPainter {
int y1= fWidget.getLinePixel(range.getStartLine());
int y2= fWidget.getLinePixel(range.getStartLine() + range.getNumberOfLines());
- return new Rectangle(0, y1, getWidth(), y2 - y1 - 1);
+ return new Rectangle(0, autoScaleUp(y1), autoScaleUp(getWidth()), autoScaleUp(y2 - y1 - 1));
}
/**

Back to the top