Comments (4)
Why do you need such method? You can create Konva.Text
instance. And then use width()
and height()
functions.
from konva.
You're absolutely right, that works out perfectly. I will make sure I research the rest of the framework thoroughly before I propose a change in the future.
from konva.
I want to reopen issue. Now I think this code might be useful. Currently if you want to create your own shape you have to use this:
var triangle = new Konva.Shape({
sceneFunc: function(context) {
context.beginPath();
context.moveTo(20, 50);
context.lineTo(220, 80);
context.quadraticCurveTo(150, 100, 260, 170);
context.closePath();
context.fillStrokeShape(this);
},
fill: '#00D2FF',
stroke: 'black',
strokeWidth: 4
});
context
argument is not native canvas context. It is Konva wrapper. But users expect here native context (and all available methods from context). So I want to make possible to work with this wrapper in completely same way as with native context.
One more example if want to change context attributes on this function you have to write:
context.setAttr('globalCompositeOperation', 'destination-over');
// or
var nativeContext = context._context;
nativeContext .globalCompositeOperation = 'destination-over';
It is all unclear.
from konva.
close by 18cce13
from konva.
Related Issues (20)
- Rotating the object image using the rotate function HOT 2
- Documentation for old releases and migration guide HOT 1
- comment typo HOT 1
- Can't cornerRadius and shadow be shared on the react-Konva Image component? HOT 1
- `canvas` dependency missing for node HOT 2
- Smooth Scrolling of Bitmap Render on LED Display HOT 3
- Feature Request: Transformer support custom create anchor HOT 3
- determine length of a line given its points and tension HOT 2
- What is the correct way to fire a custom event using react-konva HOT 1
- Rotated circle size HOT 1
- Event when you mousedown and move outside canvas. HOT 1
- Can we draw an un-closed ellipse like below? HOT 1
- Text wrong line break if have Chinese and english word
- Broken shadow after crop in safari HOT 3
- Problem with Loading Video (Konva.Node.create) HOT 1
- After caching the lines, if there is a scaling factor, the line width may appear abnormal
- Vertical text position is different between Safari and other browsers HOT 3
- Konva React Text - Cannot use SVG for text pattern HOT 1
- Different scaling behavior on SVGs in different browsers HOT 1
- path fill miss somre area HOT 2
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 konva.