mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
parent
f82da789c8
commit
d76f949502
1 changed files with 6 additions and 4 deletions
|
|
@ -413,13 +413,15 @@ DOMIntersectionObserver::Update(nsIDocument* aDocument, DOMHighResTimeStamp time
|
|||
}
|
||||
}
|
||||
|
||||
double targetArea = targetRect.width * targetRect.height;
|
||||
double intersectionArea = !intersectionRect ?
|
||||
0 : intersectionRect->width * intersectionRect->height;
|
||||
int64_t targetArea =
|
||||
(int64_t) targetRect.Width() * (int64_t) targetRect.Height();
|
||||
int64_t intersectionArea = !intersectionRect ? 0 :
|
||||
(int64_t) intersectionRect->Width() *
|
||||
(int64_t) intersectionRect->Height();
|
||||
|
||||
double intersectionRatio;
|
||||
if (targetArea > 0.0) {
|
||||
intersectionRatio = intersectionArea / targetArea;
|
||||
intersectionRatio = (double) intersectionArea / (double) targetArea;
|
||||
} else {
|
||||
intersectionRatio = intersectionRect.isSome() ? 1.0 : 0.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue