页面缩放会减慢页面渲染速度

发布于 2024-09-01 23:43:24 字数 245 浏览 1 评论 0原文

我正在构建一个非常类似于 Google 地图的地图查看器,当页面缩放(即 ctrl + 或 ctrl -)时,我遇到了一个有趣的性能问题。它似乎会影响所有主要浏览器,但据我所知,Firefox 的问题最严重。

问题是,当页面缩放时,通过拖动鼠标进行平移似乎非常缓慢。这甚至可以在谷歌地图上看到。左右平移地图并注意其平滑程度。现在按 ctrl+(3 或 4 次)。现在以相同的方式左右平移地图。注意到区别了吗?

有谁知道我如何才能最小化这个问题?

I'm building a map viewer much like Google maps and i've run into an interesting performance problem when a page is zoomed (i.e ctrl + OR ctrl -). It seems to affect all major browsers but Firefox has the worst problems as far as I can tell.

The problem is that when the page is zoomed panning by dragging the mouse seems really sluggish. This can even be seen on Google maps. Pan the map left and right and note how smooth it is. Now press ctrl+ (3 or 4 times). Now pan the map left and right in the same way. Notice the difference?

Does anyone know how I can minimize this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃颗糖壮壮胆 2024-09-08 23:43:24

由于浏览器需要重新调整和计算所有资源,因此没有真正的方法来“修复”此行为。

每个浏览器(和 IE7+)都使用缩放布局,而不是在您按 CTRL+/- 时调整文本大小。

We'll since the browser needs to rescale and compute all assets, there's no real way of "fixing" this behavior.

Every browser (and IE7+) uses scaling layout instead of resizing the text size when you hit CTRL+/-.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文