[Bug] consider using devicePixelContentBox to fix blur
oneart-dev opened this issue · comments
Version
9.5.0
Steps to Reproduce
- Open chart on PC
Current Behavior
For PC users chart bars and text can be blurry.
Expected Behavior
It's probably not easy fix to make pixel perfect render, but big chunk of users using Chrome or Chromium based browsers and for them we can use this - https://web.dev/device-pixel-content-box/
I didn't managed to apply it properly outside library code, but maybe you have morel luck
Environment
- OS: Windows
- Browser: Chrome
- Framework: not related
Any additional comments?
Confirmed blur on 27'' display with 2560x1440 resolution on latest chrome
Welcome to PR
@liihuu after quite a few hours of debugging i probably found the problem with blur. Scrolling is very smooth, but endup with very long floating point. Using Math.floor on bars helps a lot. I will prepare PR.
Also have a question, why you are using "rect" to draw a wick with fixed 1 width for candle chart. I think migrating to line can improve performance but need testing. Probably new simple line without logic for smoothing can be even faster.
And for solid candles you don't need 2 figures to draw one wick. It can be one figure. Maybe i'm missing something?
Upgrade 9.7.1
@liihuu nope, I assume docs running on latest version. This is how it looks here: https://klinecharts.com/en-US/sample/indicator.html
Pay attention to green candles blur
I already fixed it in my fork. The only solution is to use floor to make half pixel hack works.