mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
[layout] Process pairs in coord list in PolyArea.
Range -1 assures the array is even with a step size of 2, avoiding lone value processing.
This commit is contained in:
parent
d1b0f59de4
commit
2eea07fc65
1 changed files with 2 additions and 2 deletions
|
|
@ -529,7 +529,7 @@ void PolyArea::Draw(nsIFrame* aFrame, DrawTarget& aDrawTarget,
|
||||||
Point p1(pc->CSSPixelsToDevPixels(mCoords[0]),
|
Point p1(pc->CSSPixelsToDevPixels(mCoords[0]),
|
||||||
pc->CSSPixelsToDevPixels(mCoords[1]));
|
pc->CSSPixelsToDevPixels(mCoords[1]));
|
||||||
Point p2, p1snapped, p2snapped;
|
Point p2, p1snapped, p2snapped;
|
||||||
for (int32_t i = 2; i < mNumCoords; i += 2) {
|
for (int32_t i = 2; i < mNumCoords - 1; i += 2) {
|
||||||
p2.x = pc->CSSPixelsToDevPixels(mCoords[i]);
|
p2.x = pc->CSSPixelsToDevPixels(mCoords[i]);
|
||||||
p2.y = pc->CSSPixelsToDevPixels(mCoords[i+1]);
|
p2.y = pc->CSSPixelsToDevPixels(mCoords[i+1]);
|
||||||
p1snapped = p1;
|
p1snapped = p1;
|
||||||
|
|
@ -556,7 +556,7 @@ void PolyArea::GetRect(nsIFrame* aFrame, nsRect& aRect)
|
||||||
nscoord x1, x2, y1, y2, xtmp, ytmp;
|
nscoord x1, x2, y1, y2, xtmp, ytmp;
|
||||||
x1 = x2 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]);
|
x1 = x2 = nsPresContext::CSSPixelsToAppUnits(mCoords[0]);
|
||||||
y1 = y2 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]);
|
y1 = y2 = nsPresContext::CSSPixelsToAppUnits(mCoords[1]);
|
||||||
for (int32_t i = 2; i < mNumCoords; i += 2) {
|
for (int32_t i = 2; i < mNumCoords - 1; i += 2) {
|
||||||
xtmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i]);
|
xtmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i]);
|
||||||
ytmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i+1]);
|
ytmp = nsPresContext::CSSPixelsToAppUnits(mCoords[i+1]);
|
||||||
x1 = x1 < xtmp ? x1 : xtmp;
|
x1 = x1 < xtmp ? x1 : xtmp;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue