diff options
| author | Sravan Kumar Lakkimsetti | 2020-11-09 17:23:15 +0000 |
|---|---|---|
| committer | Sravan Kumar Lakkimsetti | 2020-11-09 17:23:15 +0000 |
| commit | 6c16f919b0cf84a833b695340fe4b57744c1dbb2 (patch) | |
| tree | c89a283563f0269717b1bc9d34351d744a0838fa | |
| parent | 7294d8ad1a8da968cb792fb90d92bf510dcb879f (diff) | |
| download | eclipse.platform.swt-6c16f919b0cf84a833b695340fe4b57744c1dbb2.tar.gz eclipse.platform.swt-6c16f919b0cf84a833b695340fe4b57744c1dbb2.tar.xz eclipse.platform.swt-6c16f919b0cf84a833b695340fe4b57744c1dbb2.zip | |
Bug 565899 - [HIDPI][MAC][RETINA] Gutter with linenumbers on scrambled
in (Java) editor
- The problem is getRepresentation_100() can return 200% image
representation of there are no 100% image representations available. We
need to find out whether we are getting the proper image representation
when we are creating the imageContext.
Change-Id: I5a129cd849688b2dd5089fbc907868e34c299255
Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java index 9352bb4eb5..b3ca057ae7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java @@ -1599,6 +1599,14 @@ public long internal_new_GC (GCData data) { try { int scaleFactor = DPIUtil.getDeviceZoom() / 100; NSBitmapImageRep imageRep = getRepresentation(); + NSSize imgSize = handle.size(); + NSSize targetSize = new NSSize(); + targetSize.height = imgSize.height * scaleFactor; + targetSize.width = imgSize.width * scaleFactor; + + if (!((imageRep.pixelsHigh() == targetSize.height) && (imageRep.pixelsWide() == targetSize.width))) { + imageRep = createImageRep(targetSize); + } NSGraphicsContext context = NSGraphicsContext.graphicsContextWithBitmapImageRep(imageRep); if (context == null) { |
