Comments (2)
Thanks for reporting this issue. This is indeed a bug — sort of.
When you add a Box
, you are really adding six Rect
s to your model. So if you add that Box
to a Group
, then those six Rect
will not update their z-index sorting.
The simplest way to resolve this is to enable updateSort: true
on the containing Group
.
let group = new Group({
addTo: illo,
updateSort: true,
});
new Zdog.Box({
addTo: group,
});
See Box in Group updateSort demo on CodePen
But if you indeed want a Box
in a Group
without sorting, then you need to add an additional Group
with updateSort: true
just for the box.
let group = new Zdog.Group({
addTo: illo,
});
// add other shapes to group
let circle = new Zdog.Ellipse({
addTo: group,
});
circle.copy({
});
// create separate Group for Box to updateSort
let boxGroup = new Zdog.Group({
addTo: group,
updateSort: true,
});
// add box to boxGroup
new Zdog.Box({
addTo: boxGroup,
});
See Box in separate Group demo on CodePen
from zdog.
Oh, thank you. I might have more issues, but that is one of them (trying to recreate gif on right, and rotation is 😕) https://codepen.io/forresto/pen/YbMQXj?editors=0010
Edit: fixed with 👇 .
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.