Annotations: fix matchFunc (#13037)
Some checks failed
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Has been cancelled
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Has been cancelled

Compare only datetime and start/end positions, it's enough.
Closes #13030.
This commit is contained in:
hius07
2025-01-10 09:48:25 +02:00
committed by GitHub
parent 9b444cba89
commit 5cd9494ae9

View File

@@ -350,8 +350,7 @@ function ReaderAnnotation:getMatchFunc()
if self.ui.rolling then
doesMatch = function(a, b)
if (a.datetime ~= nil and b.datetime ~= nil and a.datetime ~= b.datetime)
or (not a.drawer) ~= (not b.drawer)
or a.page ~= b.page
or a.pos0 ~= b.pos0
or a.pos1 ~= b.pos1 then
return false
end
@@ -360,7 +359,6 @@ function ReaderAnnotation:getMatchFunc()
else
doesMatch = function(a, b)
if (a.datetime ~= nil and b.datetime ~= nil and a.datetime ~= b.datetime)
or (not a.drawer) ~= (not b.drawer)
or a.page ~= b.page
or (a.pos0 and (a.pos0.x ~= b.pos0.x or a.pos1.x ~= b.pos1.x
or a.pos0.y ~= b.pos0.y or a.pos1.y ~= b.pos1.y)) then