Skip to content

Commit

Permalink
Fix cursor behavior in memory view on HiDPI (#645)
Browse files Browse the repository at this point in the history
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 #641
  • Loading branch information
mshahzadiftikhar authored Dec 27, 2023
1 parent 533125c commit 93c136d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ protected int getCellCharacterWidth() {
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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ protected int getCellCharacterWidth() {
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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected void editCell(BigInteger address, int subCellPosition, char character)
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;
Expand Down

0 comments on commit 93c136d

Please sign in to comment.