Skip to content

Commit 195a3bf

Browse files
ShahzaibIbrahimfedejeanne
authored andcommitted
Fix for normal monitor
1 parent ad2df85 commit 195a3bf

File tree

1 file changed

+2
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+2
-2
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ void drawInPixels (GC gc, int xInPoints, int yInPoints, int selectionStart, int
845845
int drawYWithLineHeight = DPIUtil.scaleUp(getDevice(), yInPoints + lineY[line+1] - lineSpacingInPoints, getZoom(gc));
846846
int drawYWithLineHeightWithSpacing = DPIUtil.scaleUp(getDevice(), yInPoints + lineY[line+1], getZoom(gc));
847847
int lineHeight = DPIUtil.scaleUp(getDevice(), lineY[line+1] - lineY[line] - lineSpacingInPoints, getZoom(gc));
848-
int lineHeightWithSpacing = DPIUtil.scaleUp(getDevice(), lineY[line+1] - lineY[line], getZoom(gc));
848+
int lineHeightWithSpacing = drawYWithLineHeightWithSpacing - drawY;
849849
//Draw last line selection
850850
boolean extents = false;
851851
if ((flags & (SWT.FULL_SELECTION | SWT.DELIMITER_SELECTION)) != 0 && (hasSelection || (flags & SWT.LAST_LINE_SELECTION) != 0)) {
@@ -873,7 +873,7 @@ void drawInPixels (GC gc, int xInPoints, int yInPoints, int selectionStart, int
873873
Gdip.Graphics_FillRectangle(gdipGraphics, gdipSelBackground, drawX + lineWidthInPixels[line], drawY, width, lineHeightWithSpacing);
874874
} else {
875875
OS.SelectObject(hdc, selBackground);
876-
OS.PatBlt(hdc, drawX + lineWidthInPixels[line], drawY, width, drawYWithLineHeightWithSpacing, OS.PATCOPY);
876+
OS.PatBlt(hdc, drawX + lineWidthInPixels[line], drawY, width, lineHeightWithSpacing, OS.PATCOPY);
877877
}
878878
}
879879
}

0 commit comments

Comments
 (0)