Skip to content

Replacing Image(Device, ImageData) constructor in DefaultRangeIndicator with Image(Device, ImageDataProvider) #3004

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arunjose696
Copy link

DefaultRangeIndicator previously used Image(Device, ImageData) constructor to draw a grid to display the selected range.

Previously, the grid was rendered using a 1×1 pixel checkerboard pattern (blue and white), which was mainly inteded to work at 100% zoom. However, at higher zoom levels (e.g., 150%, 200%), the visual intensity of the pattern becomes different, causing the grid to appear visually inconsistent across zooms.

Figures below uses Image(Device, ImageData)


200%

100%

The new implementation uses Image(Device, ImageDataProvider) adapts the grid's block size based on the zoom scale. Instead of always using 1×1 blocks, it calculates the block size by rounding the zoom factor:

For zoom levels like 100%, 125%, etc., block size = 1 (no change).

For higher zoom levels like 150%, 200%, etc., block size = 2.

This means the grid will now use 2×2 rectangles for higher zooms, resulting in a visual appearance that better matches how the original 1×1 pattern looks on standard (100%) displays. This preserves visual consistency across different zoom levels and monitor scaling settings.

Figures below Uses Image(Device, ImageDataProvider)


100%

125%

150%

175%

200%

Contributes to vi-eclipse/Eclipse-Platform#199

@arunjose696 arunjose696 force-pushed the bug/arun/199/rangeIndicator branch from ae6249d to 047fde5 Compare May 22, 2025 13:41
…/texteditor/DefaultRangeIndicator.java

Co-authored-by: Federico Jeanne <[email protected]>
@arunjose696 arunjose696 force-pushed the bug/arun/199/rangeIndicator branch from 047fde5 to 8f34f2e Compare May 22, 2025 14:03
Copy link
Contributor

Test Results

 1 824 files  ±0   1 824 suites  ±0   1h 53m 37s ⏱️ + 21m 6s
 7 925 tests ±0   7 697 ✅ ±0  228 💤 ±0  0 ❌ ±0 
23 862 runs  ±0  23 114 ✅ ±0  748 💤 ±0  0 ❌ ±0 

Results for commit 8f34f2e. ± Comparison against base commit a9ec6c9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluate calling places of Image constructors with ImageData
1 participant