mirror of
https://github.com/konvajs/konva.git
synced 2026-01-23 21:34:50 +08:00
Increase default anchor size for Konva.Transformer on touch devices. fix #814
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user