mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-27 02:47:31 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
d27ddaffd7
73 changed files with 930 additions and 951 deletions
|
|
@ -24,17 +24,25 @@ struct RoundedRect {
|
|||
rect.width = std::max(0., rect.width - aLeftWidth - aRightWidth);
|
||||
rect.height = std::max(0., rect.height - aTopWidth - aBottomWidth);
|
||||
|
||||
corners.radii[NS_CORNER_TOP_LEFT].width = std::max(0., corners.radii[NS_CORNER_TOP_LEFT].width - aLeftWidth);
|
||||
corners.radii[NS_CORNER_TOP_LEFT].height = std::max(0., corners.radii[NS_CORNER_TOP_LEFT].height - aTopWidth);
|
||||
corners.radii[mozilla::eCornerTopLeft].width =
|
||||
std::max(0., corners.radii[mozilla::eCornerTopLeft].width - aLeftWidth);
|
||||
corners.radii[mozilla::eCornerTopLeft].height =
|
||||
std::max(0., corners.radii[mozilla::eCornerTopLeft].height - aTopWidth);
|
||||
|
||||
corners.radii[NS_CORNER_TOP_RIGHT].width = std::max(0., corners.radii[NS_CORNER_TOP_RIGHT].width - aRightWidth);
|
||||
corners.radii[NS_CORNER_TOP_RIGHT].height = std::max(0., corners.radii[NS_CORNER_TOP_RIGHT].height - aTopWidth);
|
||||
corners.radii[mozilla::eCornerTopRight].width =
|
||||
std::max(0., corners.radii[mozilla::eCornerTopRight].width - aRightWidth);
|
||||
corners.radii[mozilla::eCornerTopRight].height =
|
||||
std::max(0., corners.radii[mozilla::eCornerTopRight].height - aTopWidth);
|
||||
|
||||
corners.radii[NS_CORNER_BOTTOM_LEFT].width = std::max(0., corners.radii[NS_CORNER_BOTTOM_LEFT].width - aLeftWidth);
|
||||
corners.radii[NS_CORNER_BOTTOM_LEFT].height = std::max(0., corners.radii[NS_CORNER_BOTTOM_LEFT].height - aBottomWidth);
|
||||
corners.radii[mozilla::eCornerBottomLeft].width =
|
||||
std::max(0., corners.radii[mozilla::eCornerBottomLeft].width - aLeftWidth);
|
||||
corners.radii[mozilla::eCornerBottomLeft].height =
|
||||
std::max(0., corners.radii[mozilla::eCornerBottomLeft].height - aBottomWidth);
|
||||
|
||||
corners.radii[NS_CORNER_BOTTOM_RIGHT].width = std::max(0., corners.radii[NS_CORNER_BOTTOM_RIGHT].width - aRightWidth);
|
||||
corners.radii[NS_CORNER_BOTTOM_RIGHT].height = std::max(0., corners.radii[NS_CORNER_BOTTOM_RIGHT].height - aBottomWidth);
|
||||
corners.radii[mozilla::eCornerBottomRight].width =
|
||||
std::max(0., corners.radii[mozilla::eCornerBottomRight].width - aRightWidth);
|
||||
corners.radii[mozilla::eCornerBottomRight].height =
|
||||
std::max(0., corners.radii[mozilla::eCornerBottomRight].height - aBottomWidth);
|
||||
}
|
||||
gfxRect rect;
|
||||
RectCornerRadii corners;
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ ComputeMinSizeForShadowShape(const RectCornerRadii* aCornerRadii,
|
|||
Size cornerSize(0, 0);
|
||||
if (aCornerRadii) {
|
||||
const RectCornerRadii& corners = *aCornerRadii;
|
||||
for (size_t i = 0; i < RectCorner::Count; i++) {
|
||||
NS_FOR_CSS_FULL_CORNERS(i) {
|
||||
cornerSize.width = std::max(cornerSize.width, corners[i].width);
|
||||
cornerSize.height = std::max(cornerSize.height, corners[i].height);
|
||||
}
|
||||
|
|
@ -1169,7 +1169,7 @@ static void GetBlurMargins(const RectCornerRadii* aInnerClipRadii,
|
|||
Size cornerSize(0, 0);
|
||||
if (aInnerClipRadii) {
|
||||
const RectCornerRadii& corners = *aInnerClipRadii;
|
||||
for (size_t i = 0; i < RectCorner::Count; i++) {
|
||||
NS_FOR_CSS_FULL_CORNERS(i) {
|
||||
cornerSize.width = std::max(cornerSize.width, corners[i].width);
|
||||
cornerSize.height = std::max(cornerSize.height, corners[i].height);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,36 +27,6 @@ struct gfxMargin : public mozilla::gfx::BaseMargin<gfxFloat, gfxMargin> {
|
|||
: Super(aTop, aRight, aBottom, aLeft) {}
|
||||
};
|
||||
|
||||
namespace mozilla {
|
||||
namespace css {
|
||||
enum Corner {
|
||||
// this order is important!
|
||||
eCornerTopLeft = 0,
|
||||
eCornerTopRight = 1,
|
||||
eCornerBottomRight = 2,
|
||||
eCornerBottomLeft = 3,
|
||||
eNumCorners = 4
|
||||
};
|
||||
} // namespace css
|
||||
} // namespace mozilla
|
||||
#define NS_CORNER_TOP_LEFT mozilla::css::eCornerTopLeft
|
||||
#define NS_CORNER_TOP_RIGHT mozilla::css::eCornerTopRight
|
||||
#define NS_CORNER_BOTTOM_RIGHT mozilla::css::eCornerBottomRight
|
||||
#define NS_CORNER_BOTTOM_LEFT mozilla::css::eCornerBottomLeft
|
||||
#define NS_NUM_CORNERS mozilla::css::eNumCorners
|
||||
|
||||
#define NS_FOR_CSS_CORNERS(var_) \
|
||||
for (mozilla::css::Corner var_ = NS_CORNER_TOP_LEFT; \
|
||||
var_ <= NS_CORNER_BOTTOM_LEFT; \
|
||||
var_++)
|
||||
|
||||
static inline mozilla::css::Corner operator++(mozilla::css::Corner& corner, int) {
|
||||
NS_PRECONDITION(corner >= NS_CORNER_TOP_LEFT &&
|
||||
corner < NS_NUM_CORNERS, "Out of range corner");
|
||||
corner = mozilla::css::Corner(corner + 1);
|
||||
return corner;
|
||||
}
|
||||
|
||||
struct gfxRect :
|
||||
public mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> {
|
||||
typedef mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> Super;
|
||||
|
|
@ -75,35 +45,32 @@ struct gfxRect :
|
|||
*/
|
||||
bool WithinEpsilonOfIntegerPixels(gfxFloat aEpsilon) const;
|
||||
|
||||
gfxPoint AtCorner(mozilla::css::Corner corner) const {
|
||||
gfxPoint AtCorner(mozilla::Corner corner) const {
|
||||
switch (corner) {
|
||||
case NS_CORNER_TOP_LEFT: return TopLeft();
|
||||
case NS_CORNER_TOP_RIGHT: return TopRight();
|
||||
case NS_CORNER_BOTTOM_RIGHT: return BottomRight();
|
||||
case NS_CORNER_BOTTOM_LEFT: return BottomLeft();
|
||||
default:
|
||||
NS_ERROR("Invalid corner!");
|
||||
break;
|
||||
case mozilla::eCornerTopLeft: return TopLeft();
|
||||
case mozilla::eCornerTopRight: return TopRight();
|
||||
case mozilla::eCornerBottomRight: return BottomRight();
|
||||
case mozilla::eCornerBottomLeft: return BottomLeft();
|
||||
}
|
||||
return gfxPoint(0.0, 0.0);
|
||||
}
|
||||
|
||||
gfxPoint CCWCorner(mozilla::Side side) const {
|
||||
switch (side) {
|
||||
case NS_SIDE_TOP: return TopLeft();
|
||||
case NS_SIDE_RIGHT: return TopRight();
|
||||
case NS_SIDE_BOTTOM: return BottomRight();
|
||||
case NS_SIDE_LEFT: return BottomLeft();
|
||||
case mozilla::eSideTop: return TopLeft();
|
||||
case mozilla::eSideRight: return TopRight();
|
||||
case mozilla::eSideBottom: return BottomRight();
|
||||
case mozilla::eSideLeft: return BottomLeft();
|
||||
}
|
||||
MOZ_CRASH("Incomplete switch");
|
||||
}
|
||||
|
||||
gfxPoint CWCorner(mozilla::Side side) const {
|
||||
switch (side) {
|
||||
case NS_SIDE_TOP: return TopRight();
|
||||
case NS_SIDE_RIGHT: return BottomRight();
|
||||
case NS_SIDE_BOTTOM: return BottomLeft();
|
||||
case NS_SIDE_LEFT: return TopLeft();
|
||||
case mozilla::eSideTop: return TopRight();
|
||||
case mozilla::eSideRight: return BottomRight();
|
||||
case mozilla::eSideBottom: return BottomLeft();
|
||||
case mozilla::eSideLeft: return TopLeft();
|
||||
}
|
||||
MOZ_CRASH("Incomplete switch");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue