Skip to content

Commit

Permalink
Use app.file.viewedRectangle instead of latlng.
Browse files Browse the repository at this point in the history
Signed-off-by: Gökay Şatır <[email protected]>
Change-Id: Icd084deedda131624bc123da24817ba23b7b0db2
  • Loading branch information
gokaysatir committed Jan 10, 2025
1 parent 3b8d32f commit c35fde9
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions browser/src/app/SearchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,9 @@ class SearchService {
};

L.Map.THIS.fire('clearselection');
var viewTopLeftpx = L.Map.THIS.project(
L.Map.THIS.getBounds().getNorthWest(),
);
var docBoundsTopLeft = L.Map.THIS.project(
L.Map.THIS.options.maxBounds.getNorthWest(),
);
var topLeft = L.Map.THIS.unproject(
new L.Point(
Math.max(viewTopLeftpx.x, docBoundsTopLeft.x),
Math.max(viewTopLeftpx.y, docBoundsTopLeft.y),
),
);
var topLeftTwips = L.Map.THIS._docLayer._latLngToTwips(topLeft);

var searchStartPointX = topLeftTwips.x;
var searchStartPointY = topLeftTwips.y;
var searchStartPointX = app.file.viewedRectangle.x1;
var searchStartPointY = app.file.viewedRectangle.y1;
if (
L.Map.THIS._docLayer &&
L.Map.THIS._docLayer._lastSearchResult &&
Expand Down

0 comments on commit c35fde9

Please sign in to comment.