Comments (7)
Thanks.
from pikaso.
Hi @ehussain
There are two ways to access Konva
shapes through Pikaso
.
An example will help me to explain
const circle = editor.shapes.circle.insert({
/* config */
})
here circle.node
has access to the Konva shape.
So in your case circle.node.zIndex(1)
is the solution.
The second way is using update method that is provided by Pikaso.
circle.update({
zIndex: 1
})
from pikaso.
Hello @raminious
Thanks for quick response. This is very helpful. I was able to adjust zindex of shapes using shape.update({zIndex: 1}) method as you have mentioned.
However I am still facing the issue in following scenario.
- let imageShape = editor.shapes.image.insert(ImageURL) - Inserts Image URL
- let labelShape = editor.shapes.label.insert({}) - Inserts "Untitled Text"
- labelShape.update({zIndex : 99}) // making sure label remains on top and it shows properly
- let json = editor.export.toJson();
- editor.reset() // reset canvas
- editor.import.json(json) // load previous json again
After doing above steps there is issue where image always takes top place and label gets hidden behind image.
Thanks in advance.
from pikaso.
Ok, let me try to reproduce the scenario
from pikaso.
@ehussain I could reproduce the bug https://codesandbox.io/s/floral-field-o4op8c?file=/src/index.ts
Pikaso relies on Konva's toObject
method when exporting the board to JSON. in this case Konva doesn't return zIndex
with created object of toObject
This is a Konva bug, and I think they should fix it, but I'll fix it myself in Pikaso since Konva does not support exporting to JSON.
from pikaso.
@ehussain
The issue has been fixed and with v2.6.0 will be released this week.
I appreciate your contribution.
from pikaso.
released https://github.com/pikasojs/pikaso/releases/tag/v2.6.0
from pikaso.
Related Issues (20)
- I want to create a shape inside another shape HOT 1
- Show height and width on x and y axis of a shape while drawing it. HOT 2
- Help getting started with svelte HOT 2
- Sveltekit - TypeError: canvas.createCanvas is not a function HOT 5
- Ability to resize Imported Image HOT 5
- Background Image and Overlay settings HOT 1
- NodeJS Env Support HOT 4
- Allow resizing label similar to "text" shape. HOT 3
- Fix MeasurementTag when rotating shape HOT 1
- Image shapes cannot be created in NodeJs HOT 1
- Loading images from external URL gives me an CORS error. HOT 2
- Clipping objects would be very handy
- Empower developers to maintain their own state representation HOT 1
- A suggestion to avoid canvas leak on iOS/Mac safari HOT 1
- New center and zoom options HOT 11
- Import SvgModel, SvgDrawer HOT 3
- Add destroy method to Pikaso instance
- test HOT 1
- click text can not be selected
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 pikaso.