mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
parent
a984b1dd93
commit
a10c0bceab
4 changed files with 44 additions and 3 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include "mozilla/gfx/PathHelpers.h"
|
||||
#include "nsCSSRendering.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsMathUtils.h"
|
||||
#include "nsRenderingContext.h"
|
||||
#include "nsRuleNode.h"
|
||||
|
||||
|
|
@ -135,8 +136,6 @@ nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
|
|||
|
||||
const nsTArray<nsStyleCoord>& coords = basicShape->Coordinates();
|
||||
MOZ_ASSERT(coords.Length() == 1, "wrong number of arguments");
|
||||
float referenceLength = sqrt((aRefBox.width * aRefBox.width +
|
||||
aRefBox.height * aRefBox.height) / 2.0);
|
||||
nscoord r = 0;
|
||||
if (coords[0].GetUnit() == eStyleUnit_Enumerated) {
|
||||
nscoord horizontal, vertical;
|
||||
|
|
@ -150,7 +149,12 @@ nsCSSClipPathInstance::CreateClipPathCircle(DrawTarget* aDrawTarget,
|
|||
r = horizontal < vertical ? horizontal : vertical;
|
||||
}
|
||||
} else {
|
||||
r = nsRuleNode::ComputeCoordPercentCalc(coords[0], referenceLength);
|
||||
// We resolve percent <shape-radius> value for circle() as defined here:
|
||||
// https://drafts.csswg.org/css-shapes/#funcdef-circle
|
||||
const double sqrt2 = std::sqrt(2.0);
|
||||
double referenceLength = NS_hypot(aRefBox.width, aRefBox.height) / sqrt2;
|
||||
r = nsRuleNode::ComputeCoordPercentCalc(coords[0],
|
||||
NSToCoordRound(referenceLength));
|
||||
}
|
||||
|
||||
nscoord appUnitsPerDevPixel =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue