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

@@ -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) {