diff options
author | Silenio Quarti | 2011-11-09 15:55:11 +0000 |
---|---|---|
committer | Carolyn MacLeod | 2011-11-09 15:55:11 +0000 |
commit | 84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a (patch) | |
tree | 9988bdf536c1fc3d1142ea12a4857e7ed711c753 | |
parent | 943d6b15e034a4b2ef199037f7b7331f92620fef (diff) | |
download | eclipse.platform.swt-84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a.tar.gz eclipse.platform.swt-84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a.tar.xz eclipse.platform.swt-84b7f4eb839c40c67c06cf1cb3c34b24bf589c5a.zip |
Bug 362999 - SWTGraphics#scale is broken when used with Printer on
Eclipse 3.7 / GTK
3 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java index 0b79f2d4d3..b43afa6277 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Printing/gtk/org/eclipse/swt/printing/Printer.java @@ -457,6 +457,9 @@ public int /*long*/ internal_new_GC(GCData data) { double printY = OS.gtk_page_setup_get_top_margin(pageSetup, OS.GTK_UNIT_POINTS); Cairo.cairo_translate(cairo, printX, printY); Cairo.cairo_scale(cairo, screenDPI.x / (float)dpi.x, screenDPI.y / (float)dpi.y); + double[] matrix = new double[6]; + Cairo.cairo_get_matrix(cairo, matrix); + data.identity = matrix; data.cairo = cairo; isGCCreated = true; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java index cd51b3b4fd..08e999ad0c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java @@ -2792,6 +2792,9 @@ double[] identity() { } else { Cairo.cairo_matrix_init_identity(identity); } + if (data.identity != null) { + Cairo.cairo_matrix_multiply(identity, data.identity, identity); + } return identity; } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java index d507acb51b..b42a96d37a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GCData.java @@ -54,7 +54,7 @@ public final class GCData { public int /*long*/ cairo; public double cairoXoffset, cairoYoffset; public boolean disposeCairo; - public double[] clippingTransform; + public double[] identity, clippingTransform; public String string; public int stringWidth = -1; public int stringHeight = -1; |