Increase default anchor size for Konva.Transformer on touch devices. fix #814

This commit is contained in:
Anton Lavrenov 2019-12-23 10:52:49 -05:00
parent fbebc3fad2
commit 00c5ccc4bb
5 changed files with 12 additions and 6 deletions

View File

@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
* Make events work on some CSS transforms
* Fix caching on float dimensions
* Fix `mouseleave` event on stage.
* Increase default anchor size for `Konva.Transformer` on touch devices
## 4.0.18 - 2019-11-20

View File

@ -8,7 +8,7 @@
* Konva JavaScript Framework v4.0.18
* http://konvajs.org/
* Licensed under the MIT
* Date: Wed Dec 18 2019
* Date: Mon Dec 23 2019
*
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
@ -14567,6 +14567,7 @@
'bottom-center': 180,
'bottom-right': 135
};
var TOUCH_DEVICE = 'ontouchstart' in Konva._global;
function getCursor(anchorName, rad, isMirrored) {
if (anchorName === 'rotater') {
return 'crosshair';
@ -14808,7 +14809,8 @@
strokeWidth: 1,
name: name + ' _anchor',
dragDistance: 0,
draggable: true
draggable: true,
hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto'
});
var self = this;
anchor.on('mousedown touchstart', function (e) {

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -52,7 +52,7 @@ export interface ShapeConfig extends NodeConfig {
fillPriority?: string;
stroke?: string;
strokeWidth?: number;
hitStrokeWidth?: number;
hitStrokeWidth?: number | string;
strokeScaleEnabled?: boolean;
strokeHitEnabled?: boolean;
strokeEnabled?: boolean;

View File

@ -85,6 +85,8 @@ var ANGLES = {
'bottom-right': 135
};
const TOUCH_DEVICE = 'ontouchstart' in Konva._global;
function getCursor(anchorName, rad, isMirrored) {
if (anchorName === 'rotater') {
return 'crosshair';
@ -339,7 +341,8 @@ export class Transformer extends Group {
strokeWidth: 1,
name: name + ' _anchor',
dragDistance: 0,
draggable: true
draggable: true,
hitStrokeWidth: TOUCH_DEVICE ? 10 : 'auto'
});
var self = this;
anchor.on('mousedown touchstart', function(e) {