fix: use the right convertPoints function in Stories (#166)

Changed `mathUtils` -> `styleUtils` in affected stories.
development
Filip Wróbel 2023-01-06 14:16:46 +01:00 committed by GitHub
parent ee7d0fce6c
commit a247b38268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 13 deletions

View File

@ -29,7 +29,7 @@ import {
Morphing,
EventObject,
eventUtils,
mathUtils,
styleUtils,
} from '@maxgraph/core';
import { globalTypes } from '../.storybook/preview';
@ -190,7 +190,7 @@ const Template = ({ label, ...args }) => {
graph.stopEditing(false);
const pt = mathUtils.convertPoint(
const pt = styleUtils.convertPoint(
graph.container,
eventUtils.getClientX(evt2),
eventUtils.getClientY(evt2)

View File

@ -21,7 +21,7 @@ import {
RubberBandHandler,
Point,
SelectionHandler,
mathUtils,
styleUtils,
} from '@maxgraph/core';
import { globalTypes } from '../.storybook/preview';
@ -159,7 +159,7 @@ const Template = ({ label, ...args }) => {
// Replaces move preview for relative children
graphHandler.getDelta = function (me) {
const point = mathUtils.convertPoint(this.graph.container, me.getX(), me.getY());
const point = styleUtils.convertPoint(this.graph.container, me.getX(), me.getY());
let delta = new Point(point.x - this.first.x, point.y - this.first.y);
if (this.cells != null && this.cells.length > 0 && this.cells[0] != null) {

View File

@ -20,7 +20,7 @@ import {
InternalEvent,
RubberBandHandler,
eventUtils,
mathUtils,
styleUtils,
domUtils,
VertexHandler,
} from '@maxgraph/core';
@ -131,7 +131,7 @@ const Template = ({ label, ...args }) => {
img.style.height = '16px';
InternalEvent.addGestureListeners(img, (evt) => {
const pt = mathUtils.convertPoint(
const pt = styleUtils.convertPoint(
this.graph.container,
eventUtils.getClientX(evt),
eventUtils.getClientY(evt)

View File

@ -18,7 +18,7 @@ limitations under the License.
import {
Graph,
RubberBandHandler,
mathUtils,
styleUtils,
eventUtils,
InternalEvent,
Client,
@ -85,7 +85,7 @@ const Template = ({ label, ...args }) => {
evt.preventDefault();
// Gets drop location point for vertex
const pt = mathUtils.convertPoint(
const pt = styleUtils.convertPoint(
graph.container,
eventUtils.getClientX(evt),
eventUtils.getClientY(evt)

View File

@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { Graph, mathUtils } from '@maxgraph/core';
import { Graph, styleUtils } from '@maxgraph/core';
import { globalTypes } from '../.storybook/preview';
@ -47,7 +47,7 @@ const Template = ({ label, ...args }) => {
// them here. Storing them in the event means the overridden
// method doesn't have to do this again.
if (me.graphX == null || me.graphY == null) {
const pt = mathUtils.convertPoint(container, me.getX(), me.getY());
const pt = styleUtils.convertPoint(container, me.getX(), me.getY());
me.graphX = pt.x;
me.graphY = pt.y;
@ -74,7 +74,7 @@ const Template = ({ label, ...args }) => {
dblClick(evt, cell) {
// Overrides double click handling to use the tolerance
if (cell == null) {
const pt = mathUtils.convertPoint(
const pt = styleUtils.convertPoint(
el,
eventUtils.getClientX(evt),
eventUtils.getClientY(evt)

View File

@ -18,7 +18,7 @@ limitations under the License.
import {
Graph,
KeyHandler,
mathUtils,
styleUtils,
domUtils,
cloneUtils,
eventUtils,
@ -94,7 +94,7 @@ const Template = ({ label, ...args }) => {
// a mouse event
if (evt != null) {
// Finds the relative coordinates inside the cell
const point = mathUtils.convertPoint(
const point = styleUtils.convertPoint(
this.container,
eventUtils.getClientX(evt),
eventUtils.getClientY(evt)