Skip to content

Commit 1f75603

Browse files
gokaysatireszkadev
authored andcommitted
Fix the coordinate calculation in postCoreMouseEvent function in MouseControl.ts.
Run prettier for OtherViewCellCursorSection.ts file. Signed-off-by: Gökay Şatır <[email protected]> Change-Id: I73bf4574faeaec99ddf40242f9739499701f616e
1 parent 366b6fb commit 1f75603

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

browser/src/canvas/sections/MouseControl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ class MouseControl extends CanvasSectionObject {
8686
const viewToDocumentPos = point.clone();
8787

8888
// Convert to pure canvas html element coordinate.
89-
viewToDocumentPos.pX -=
90-
app.activeDocument.activeView.viewedRectangle.pX1 +
89+
viewToDocumentPos.pX +=
90+
-app.activeDocument.activeView.viewedRectangle.pX1 +
9191
app.sectionContainer.getDocumentAnchor()[0];
92-
viewToDocumentPos.pY -=
93-
app.activeDocument.activeView.viewedRectangle.pY1 +
92+
viewToDocumentPos.pY +=
93+
-app.activeDocument.activeView.viewedRectangle.pY1 +
9494
app.sectionContainer.getDocumentAnchor()[1];
9595

9696
const pX =

browser/src/canvas/sections/OtherViewCursorSection.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,7 @@ class TextCursorSection extends HTMLObjectSection {
113113

114114
section.setPosition(rectangle.pX1, rectangle.pY1);
115115
} else {
116-
section = new TextCursorSection(
117-
viewId,
118-
color,
119-
rectangle,
120-
part,
121-
mode,
122-
);
116+
section = new TextCursorSection(viewId, color, rectangle, part, mode);
123117
app.sectionContainer.addSection(section);
124118
TextCursorSection.sectionPointers.push(section);
125119
}

0 commit comments

Comments
 (0)