Fix coordinate calculation error of cell selection area.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I5f130924455cd29018baf6fbc14c1ceffd29cf46
This commit is contained in:
Gökay Şatır 2024-05-21 10:10:34 +03:00 committed by Gökay ŞATIR
parent 2acc5a94c9
commit 85b93bfb9d
2 changed files with 4 additions and 2 deletions

View file

@ -13,7 +13,7 @@ declare var L: any;
declare var app: any;
app.definitions.AutoFillMarkerSection =
class AutoFillMarkerSection extends app.definitions.canvasSectionObject {
class AutoFillMarkerSection extends CanvasSectionObject {
name: string = L.CSections.AutoFillMarker.name;
processingOrder: number = L.CSections.AutoFillMarker.processingOrder;
drawingOrder: number = L.CSections.AutoFillMarker.drawingOrder;

View file

@ -3175,7 +3175,9 @@ L.CanvasTileLayer = L.Layer.extend({
var boundsTwips = this._convertToTileTwipsSheetArea(new L.Bounds(topLeftTwips, bottomRightTwips));
var oldSelection = this._cellSelectionArea ? this._cellSelectionArea.clone(): null;
this._cellSelectionArea = new app.definitions.simpleRectangle(boundsTwips.min.x, boundsTwips.min.y, parseInt(strTwips[2]), parseInt(strTwips[3]));
const adjustedTwipsWidth = boundsTwips.max.x - boundsTwips.min.x;
const adjustedTwipsHeight = boundsTwips.max.y - boundsTwips.min.y;
this._cellSelectionArea = new app.definitions.simpleRectangle(boundsTwips.min.x, boundsTwips.min.y, adjustedTwipsWidth, adjustedTwipsHeight);
if (autofillMarkerSection)
autofillMarkerSection.calculatePositionViaCellSelection([this._cellSelectionArea.pX2, this._cellSelectionArea.pY2]);