devexperts / dxcharts-lite

Flexible financial charts based on HTML5 canvas
https://devexperts.com/dxcharts/
Mozilla Public License 2.0
45 stars 9 forks source link

Fix canvas pinch event #161

Closed Keelaro1 closed 4 months ago

KirillBobkov commented 4 months ago

Actually, I don't think that we need such many code, to freeze chart, when max zoom reached, too much "hacks" here.

Keelaro1 commented 4 months ago

Actually, I don't think that we need such many code, to freeze chart, when max zoom reached, too much "hacks" here.

Just freezing chart makes it work worse, because pinch event is based on the candles the fingers are touching.

Reaching max zoom In and freezing chart will save the scale according to these candles, but if the user continued to zoom In (which is most likely), the candles would be changed, and the next zoomOut will "jump" to these candles, which leads to jump in scale

KirillBobkov commented 4 months ago

Actually, I don't think that we need such many code, to freeze chart, when max zoom reached, too much "hacks" here.

Just freezing chart makes it work worse, because pinch event is based on the candles the fingers are touching.

Reaching max zoom In and freezing chart will save the scale according to these candles, but if the user continued to zoom In (which is most likely), the candles would be changed, and the next zoomOut will "jump" to these candles, which leads to jump in scale

Freezing is not correct word from my side, I mean skipping zoom event if zoom is reached (max or min). And it should not depend only on touch events, it should depend also for wheel, touchpad scale, or scale X. Functionality by skipping zoom scale should be complexed

KirillBobkov commented 4 months ago

Since we have a request from client for delivery, created a separated ticket for refactoring this PR. Merge.