konvajs

What is the best way to drag a transformer by dragging from empty areas in Konvajs?

若如初见. 提交于 2021-02-10 00:05:20
问题 I'm currently following this guide to select shapes in the stage and put them inside a Transformer. If possible, I'd like to drag an entire Transformer with all of its content without touching any of the shapes inside. For example, I have two lines that are far from each other. Both of them are nodes inside a Transformer and can be dragged as long as I click one of those 2 lines. However, if I tried to drag from any of the empty area inside the Transformer nothing would happen (or the

How can I get the intersection of three shapes colliding and delete the parts that are not colliding using HMTL5 Javascript Canvas?

喜你入骨 提交于 2021-02-07 19:17:54
问题 I've recently posted a similar question specifically for KonvaJs here, however, I have not gotten any answer and wanted to go directly to the root of what KonvaJs uses. I would like to know if there's a standard way of solving the following problem using HMTL5 Javascript Canvas. If I am given 3 circles and they are positioned as the primary color circles (3 circles intersecting each other), is there a function that might help me to delete the parts that are not colliding with anything and

Konva infinite grid in React

删除回忆录丶 提交于 2021-02-07 10:19:43
问题 i,m trying to learn how to use canvas via a package react -konva. I fount the exact thing what i nead write in javascript but i nead to have it like react component and add images where rectangles are on button click. Can anyone help me to reorganize the code to display it in react.... This is the fiddle that i found on the web...https://jsfiddle.net/kiksy/jqo2h3dx/2/ const stage = new Konva.Stage({ container: 'container', width: window.innerWidth, height: window.innerHeight, draggable: true

Increase text size in Konva.js map when user zooms out

ε祈祈猫儿з 提交于 2021-01-29 21:39:09
问题 so my question is the following. Using Javascript, HTML, CSS and the library Konvas.js, I'm drawing in a grid, creating segments. Each of those segments as a real value, as presented in the Image 1. My goal is to increase the size of the text with the real value when a user zooms out(Image 2) Here are the parts of code that makes the draw of the real value, as well it's FontSize. The var lenTxt it 's the one that holds the real value. Thanks function redrawSegments(segArray){ drawLayer

Increase text size in Konva.js map when user zooms out

纵然是瞬间 提交于 2021-01-29 15:16:11
问题 so my question is the following. Using Javascript, HTML, CSS and the library Konvas.js, I'm drawing in a grid, creating segments. Each of those segments as a real value, as presented in the Image 1. My goal is to increase the size of the text with the real value when a user zooms out(Image 2) Here are the parts of code that makes the draw of the real value, as well it's FontSize. The var lenTxt it 's the one that holds the real value. Thanks function redrawSegments(segArray){ drawLayer

How to connect 2 objects using a line using konvajs in vuejs?

馋奶兔 提交于 2021-01-29 11:21:00
问题 Good morning, I find myself working with the Konvajs library, https://github.com/konvajs/vue-konva There is the following documentation: https://konvajs.org/docs/sandbox/Connected_Objects.html, but I can't implement it with vuejs Since what I need to do is that when selecting object 1, I can drag and form the arrow and when selecting object 2, they are linked Currently I have built the following: <template> <v-container> <v-stage :config="configKonva"> <v-layer> <v-circle :config=

Using image mask with globalCompositeOperation on KonvaJS?

我与影子孤独终老i 提交于 2021-01-27 10:44:15
问题 I am using Konva.js framework and trying to apply an image mask over an other one. The code is fully copied from this post. In this jsfiddle example there is small modifications to add a background (Rect). The problem is that the background is not properly drawn. To see it in action in the code there is a line to comment/uncomment (to see the problem in action). Is someone have any idea to achieve this ? Best let stage = new Konva.Stage({ container: 'container', width: window.innerWidth,

Using image mask with globalCompositeOperation on KonvaJS?

此生再无相见时 提交于 2021-01-27 10:42:04
问题 I am using Konva.js framework and trying to apply an image mask over an other one. The code is fully copied from this post. In this jsfiddle example there is small modifications to add a background (Rect). The problem is that the background is not properly drawn. To see it in action in the code there is a line to comment/uncomment (to see the problem in action). Is someone have any idea to achieve this ? Best let stage = new Konva.Stage({ container: 'container', width: window.innerWidth,

How can I get the intersection of three shapes colliding and delete the parts that are not colliding in KonvaJs?

雨燕双飞 提交于 2020-12-06 05:31:29
问题 If I am given 3 circles and they are positioned as the primary colors circles (3 circles intersecting each other), is there a function that might help me to delete the parts that are not colliding with anything and just keep the intersecting parts? Another example could be drawing three lines in such a way that it forms a triangle. By deleting the parts that are not colliding, we would end up with 3 points (at least visually, not sure if I end up with 3 in total or 6 from stacking up), which