Comments (5)
If you'd like to see more resize options, please add a 👍 and respond with which behavior from above you're looking for.
Hi Jack. Thanks for digging into this and for your careful consideration of the issue.
Currently resize: true
works as resize: 'respect-natural-dom-size-and-css'
(as you put it). Zdog takes the original width
and height
measurements, and then updates the rendering element & internal geometries to match that display ratio. If you inspect the canvas demo, you'll see the actual width
and height
attributes change. In the SVG demo, the viewBox
attribute changess. With resize: true
canvas and SVG element both with scale proportionally, but the outer CSS may differ between the two elements.
As for the other use cases, yeah, I can see people needing these. But I'd like to hear what they're trying to achieve before I start more features. Dealing with resizing was tricky.
from zdog.
Thanks for your reply. Yeah, resizing is definitely a tricky thing. Expectations from developers could vary widely.
I think I may not be seeing the same thing as you described. In test case 1, the canvas does not change size for me when resizing my browser. It stays at 480px × 280px. I'm attaching a GIF of the behavior I see here just to clarify. Do you get the same behavior?
With your description, I would expect to see the canvas element expand to the full width of the browser while retaining a 2:1
aspect ratio since it has the following CSS:
.zdog-canvas {
display: block;
width: 100%;
}
I wonder if this might be an issue where the browser needs an extra frame to recalculate the DOM's representation? Kind of like how if you remove a CSS class and then add the CSS class back to the same element within the same frame of execution, you wouldn't see any change.
from zdog.
Aaaaaah. There's a bug with high pixelRatio screens. Dang. Okay, I'll look into this. Thanks for reporting that.
from zdog.
Oh ok, great to hear! I think fixing that should solve everything that was going through my head. There's no need to add extra complications since resize: true
as you described is super flexible. All of the above scenarios I outlined could be covered with that.
Feel free to close this once fixed, thanks!
from zdog.
v1.0.2 has been released with fix for this bug Please update! Thanks again for reporting this issue. Closing as fixed.
from zdog.
Related Issues (20)
- Migrate codebase to ES8/TypeScript? HOT 8
- Element overlay late HOT 1
- Would wasm make it any faster? HOT 3
- 3D shape properties are not updated HOT 3
- Line across inside cylinder when fill is false HOT 2
- scene = new Zdog.Anchor() - Memory Leak? HOT 1
- why do shapes vanish when on a box HOT 1
- how animate a shape with a path HOT 1
- using for-loop and variables in path command HOT 1
- camera move(feature request) HOT 2
- Stroke Dasharray [feature request]
- Better documentation of normalizeRotate()
- Library
- how to import module of Zdog?
- Documentation website seems to be down
- Hollow Cone doesn't render in all rotations
- add light source
- dragRotate doesn't work HOT 1
- smoke effects cause model flickering HOT 3
- AddTo can't change after creation of Zdog element HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zdog.