Fix cursor behavior in memory view on HiDPI (#645)

Cursor not behaving correctly in memory view editor while
chaging variable value on Hi-DPI #641

Used GC.textExtent() method for getting width of a character as
it handles zooming factor

Fixes https://github.com/eclipse-cdt/cdt/issues/641
This commit is contained in:
Shahzad Iftikhar 2023-12-28 04:06:50 +05:00 committed by GitHub
parent 533125c6d4
commit 93c136de3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.floatingpoint;singleton:=true
Bundle-Version: 1.2.0.qualifier
Bundle-Version: 1.2.100.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core;bundle-version="3.7.100",
org.eclipse.debug.ui;bundle-version="3.8.1",

View file

@ -774,7 +774,7 @@ public abstract class FPAbstractPane extends Canvas {
if (fCharacterWidth == -1) {
GC gc = new GC(this);
gc.setFont(fRendering.getFont());
fCharacterWidth = gc.getAdvanceWidth('F');
fCharacterWidth = gc.textExtent("F").x; //$NON-NLS-1$
gc.dispose();
}

View file

@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.ui.memory.traditional;singleton:=true
Bundle-Version: 1.7.0.qualifier
Bundle-Version: 1.7.100.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.debug.core,
org.eclipse.debug.ui,

View file

@ -742,7 +742,7 @@ public abstract class AbstractPane extends Canvas {
if (fCharacterWidth == -1) {
GC gc = new GC(this);
gc.setFont(fRendering.getFont());
fCharacterWidth = gc.getAdvanceWidth('F');
fCharacterWidth = gc.textExtent("F").x; //$NON-NLS-1$
gc.dispose();
}

View file

@ -79,7 +79,7 @@ public class TextPane extends AbstractPane {
protected int getCellWidth() {
GC gc = new GC(this);
gc.setFont(fRendering.getFont());
int width = gc.getAdvanceWidth('F');
int width = gc.textExtent("F").x; //$NON-NLS-1$
gc.dispose();
return fRendering.getBytesPerColumn() / fRendering.getBytesPerCharacter() * width;