mirror of
https://github.com/penpot/penpot.git
synced 2025-07-13 23:27:16 +02:00
🐛 Fix panning and scroll when dpr > 1 (render wasm)
This commit is contained in:
parent
e7e39a5521
commit
4a9f6ea04e
1 changed files with 3 additions and 6 deletions
|
@ -605,10 +605,7 @@ impl RenderState {
|
||||||
// Scale and translate the target according to the cached data
|
// Scale and translate the target according to the cached data
|
||||||
let navigate_zoom = self.viewbox.zoom / self.cached_viewbox.zoom;
|
let navigate_zoom = self.viewbox.zoom / self.cached_viewbox.zoom;
|
||||||
|
|
||||||
canvas.scale((
|
canvas.scale((navigate_zoom, navigate_zoom));
|
||||||
navigate_zoom * self.options.dpr(),
|
|
||||||
navigate_zoom * self.options.dpr(),
|
|
||||||
));
|
|
||||||
|
|
||||||
let TileRect(start_tile_x, start_tile_y, _, _) =
|
let TileRect(start_tile_x, start_tile_y, _, _) =
|
||||||
tiles::get_tiles_for_viewbox_with_interest(
|
tiles::get_tiles_for_viewbox_with_interest(
|
||||||
|
@ -616,8 +613,8 @@ impl RenderState {
|
||||||
VIEWPORT_INTEREST_AREA_THRESHOLD,
|
VIEWPORT_INTEREST_AREA_THRESHOLD,
|
||||||
scale,
|
scale,
|
||||||
);
|
);
|
||||||
let offset_x = self.viewbox.area.left * self.cached_viewbox.zoom;
|
let offset_x = self.viewbox.area.left * self.cached_viewbox.zoom * self.options.dpr();
|
||||||
let offset_y = self.viewbox.area.top * self.cached_viewbox.zoom;
|
let offset_y = self.viewbox.area.top * self.cached_viewbox.zoom * self.options.dpr();
|
||||||
|
|
||||||
canvas.translate((
|
canvas.translate((
|
||||||
(start_tile_x as f32 * tiles::TILE_SIZE) - offset_x,
|
(start_tile_x as f32 * tiles::TILE_SIZE) - offset_x,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue