fix: call static methods via class instead of instance in linearElementEditor (#5561)
* fix: call getMidPoint via class instead of instance * fix * fix
This commit is contained in:
parent
5a8dbe8030
commit
b67a2b4f65
@ -386,7 +386,7 @@ export class LinearElementEditor {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const midPoint = this.getMidPoint(linearElementEditor);
|
const midPoint = LinearElementEditor.getMidPoint(linearElementEditor);
|
||||||
if (midPoint) {
|
if (midPoint) {
|
||||||
const threshold =
|
const threshold =
|
||||||
LinearElementEditor.POINT_HANDLE_SIZE / appState.zoom.value;
|
LinearElementEditor.POINT_HANDLE_SIZE / appState.zoom.value;
|
||||||
@ -453,7 +453,7 @@ export class LinearElementEditor {
|
|||||||
appState,
|
appState,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
const midPoint = this.getMidPoint(linearElementEditor);
|
const midPoint = LinearElementEditor.getMidPoint(linearElementEditor);
|
||||||
if (midPoint) {
|
if (midPoint) {
|
||||||
mutateElement(element, {
|
mutateElement(element, {
|
||||||
points: [
|
points: [
|
||||||
@ -715,7 +715,8 @@ export class LinearElementEditor {
|
|||||||
x: number,
|
x: number,
|
||||||
y: number,
|
y: number,
|
||||||
) {
|
) {
|
||||||
const pointHandles = this.getPointsGlobalCoordinates(element);
|
const pointHandles =
|
||||||
|
LinearElementEditor.getPointsGlobalCoordinates(element);
|
||||||
let idx = pointHandles.length;
|
let idx = pointHandles.length;
|
||||||
// loop from right to left because points on the right are rendered over
|
// loop from right to left because points on the right are rendered over
|
||||||
// points on the left, thus should take precedence when clicking, if they
|
// points on the left, thus should take precedence when clicking, if they
|
||||||
@ -725,7 +726,7 @@ export class LinearElementEditor {
|
|||||||
if (
|
if (
|
||||||
distance2d(x, y, point[0], point[1]) * zoom.value <
|
distance2d(x, y, point[0], point[1]) * zoom.value <
|
||||||
// +1px to account for outline stroke
|
// +1px to account for outline stroke
|
||||||
this.POINT_HANDLE_SIZE + 1
|
LinearElementEditor.POINT_HANDLE_SIZE + 1
|
||||||
) {
|
) {
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user