Giter Club home page Giter Club logo

Comments (4)

lslzl3000 avatar lslzl3000 commented on May 16, 2024

Screenshot 2023-05-18 at 13 01 18

我这里测试正常,不加css的话 canvas 是默认大小,没有发现自己变大的情况
如果需要自定义大小,可以通过 css 改变 canvas 大小:

Screenshot 2023-05-18 at 13 02 59

from orillusion.

FliPPeDround avatar FliPPeDround commented on May 16, 2024

动画

我确实遇到了这个问题,在其他电脑上也复现了,我还需要提供什么信息可以帮助排除这个问题

image

from orillusion.

lslzl3000 avatar lslzl3000 commented on May 16, 2024

@FliPPeDround 已排查到问题所在,主要是没有手动规范canvas的css大小,在dpr不等于1的屏幕上会导致canvas会根据内容大小resize,从而循环触发resize越来越大。

目前来讲,请手动设置一个 css 来规范canvas style 的 width 和 height,不要使用默认值(即无style width height)
我们后面会优化resize的方案,避免这种情况

from orillusion.

lslzl3000 avatar lslzl3000 commented on May 16, 2024

已在 #163 中修复canvas无默认大小的情况,会跟随下个版本发布

from orillusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.