Skip to content

Replacing usages of Image(Display, Rectangle) #2953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.e4.ui.workbench3/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.e4.ui.workbench3;singleton:=true
Bundle-Version: 0.17.400.qualifier
Bundle-Version: 0.17.500.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
Expand Down Expand Up @@ -285,7 +286,8 @@ public void run() {

// Take a screenshot:
GC gc = new GC(display);
final Image image = new Image(display, display.getBounds());
Rectangle bounds = display.getBounds();
final Image image = new Image(display, bounds.width, bounds.height);
gc.copyArea(image, 0, 0);
gc.dispose();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static String takeScreenshot(Class<?> testClass, String name, PrintStream
GC gc = new GC(display);
Rectangle displayBounds= display.getBounds();
out.println("Display @ " + displayBounds);
final Image image = new Image(display, displayBounds);
final Image image = new Image(display, displayBounds.width, displayBounds.height);
gc.copyArea(image, 0, 0);
gc.dispose();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package org.eclipse.jface.tests.widgets;

import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell;
import org.junit.After;
import org.junit.AfterClass;
Expand All @@ -27,7 +26,7 @@ public class AbstractFactoryTest {

@BeforeClass
public static void classSetup() {
image = new Image(null, new Rectangle(1, 1, 1, 1));
image = new Image(null, 1, 1);
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public static String takeScreenshot(Class<?> testClass, String name, PrintStream
GC gc = new GC(display);
Rectangle displayBounds= display.getBounds();
out.println("Display @ " + displayBounds);
final Image image = new Image(display, displayBounds);
final Image image= new Image(display, displayBounds.width, displayBounds.height);
gc.copyArea(image, 0, 0);
gc.dispose();

Expand Down
Loading