mirror of
https://github.com/konvajs/konva.git
synced 2025-07-16 22:33:51 +08:00
fix corner radous for Label shape
This commit is contained in:
parent
eda967c07e
commit
3616d38d85
@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Fixed
|
### Fixed
|
||||||
- correct `Konva.Arrow` drawing. Now it works better.
|
- correct `Konva.Arrow` drawing. Now it works better.
|
||||||
- Better support for dragging when mouse out of stage
|
- Better support for dragging when mouse out of stage
|
||||||
|
- Better corner radius for `Label` shape
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- event delegation. You can use it in this way: `layer.on('click', 'Circle', handler);`
|
- event delegation. You can use it in this way: `layer.on('click', 'Circle', handler);`
|
||||||
|
8
konva.js
8
konva.js
@ -15767,10 +15767,14 @@ var Konva = {};
|
|||||||
pointerDirection = this.getPointerDirection(),
|
pointerDirection = this.getPointerDirection(),
|
||||||
pointerWidth = this.getPointerWidth(),
|
pointerWidth = this.getPointerWidth(),
|
||||||
pointerHeight = this.getPointerHeight(),
|
pointerHeight = this.getPointerHeight(),
|
||||||
cornerRadius = this.getCornerRadius();
|
cornerRadius = Math.min(this.getCornerRadius, width / 2, height / 2);
|
||||||
|
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.moveTo(0, 0);
|
if (!cornerRadius) {
|
||||||
|
context.moveTo(0, 0);
|
||||||
|
} else {
|
||||||
|
context.moveTo(cornerRadius, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (pointerDirection === UP) {
|
if (pointerDirection === UP) {
|
||||||
context.lineTo((width - pointerWidth) / 2, 0);
|
context.lineTo((width - pointerWidth) / 2, 0);
|
||||||
|
2
konva.min.js
vendored
2
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -185,10 +185,14 @@
|
|||||||
pointerDirection = this.getPointerDirection(),
|
pointerDirection = this.getPointerDirection(),
|
||||||
pointerWidth = this.getPointerWidth(),
|
pointerWidth = this.getPointerWidth(),
|
||||||
pointerHeight = this.getPointerHeight(),
|
pointerHeight = this.getPointerHeight(),
|
||||||
cornerRadius = this.getCornerRadius();
|
cornerRadius = Math.min(this.getCornerRadius, width / 2, height / 2);
|
||||||
|
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.moveTo(0, 0);
|
if (!cornerRadius) {
|
||||||
|
context.moveTo(0, 0);
|
||||||
|
} else {
|
||||||
|
context.moveTo(cornerRadius, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (pointerDirection === UP) {
|
if (pointerDirection === UP) {
|
||||||
context.lineTo((width - pointerWidth) / 2, 0);
|
context.lineTo((width - pointerWidth) / 2, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user