Commit b138f042 authored by Morten Stenshorne's avatar Morten Stenshorne Committed by Commit Bot

Specify which border sides to include for inner border radius.

When calculating the inner border radius, just like when calculating the
outer border radius, we need to specify which borders that are present,
to get it right.

Bug: 1119323
Change-Id: I144eea827fc7222bd4919a0be57c4cba442ed8da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362613Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800038}
parent e09082e4
...@@ -140,7 +140,8 @@ FloatRoundedRect RoundedBorderGeometry::PixelSnappedRoundedInnerBorder( ...@@ -140,7 +140,8 @@ FloatRoundedRect RoundedBorderGeometry::PixelSnappedRoundedInnerBorder(
if (style.HasBorderRadius()) { if (style.HasBorderRadius()) {
FloatRoundedRect::Radii radii = FloatRoundedRect::Radii radii =
PixelSnappedRoundedBorder(style, border_rect).GetRadii(); PixelSnappedRoundedBorder(style, border_rect, sides_to_include)
.GetRadii();
// Insets use negative values. // Insets use negative values.
radii.Shrink(-insets.Top().ToFloat(), -insets.Bottom().ToFloat(), radii.Shrink(-insets.Top().ToFloat(), -insets.Bottom().ToFloat(),
-insets.Left().ToFloat(), -insets.Right().ToFloat()); -insets.Left().ToFloat(), -insets.Right().ToFloat());
......
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<style>
.spacer { display:inline-block; width:20px; }
</style>
<p>There should be two good-looking arcs below.</p>
<div style="font-size:40px; line-height:100px;">
<span style="border:20px solid; border-radius:40px; border-right:none; border-top-right-radius:0; border-bottom-right-radius:0;">
<span class="spacer"></span></span>
<br>
<span style="border:20px solid; border-radius:40px; border-left:none; border-top-left-radius:0; border-bottom-left-radius:0;">
<span class="spacer"></span></span>
</div>
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-backgrounds-3/#the-border-radius">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1119323">
<link rel="match" href="border-radius-012-ref.html">
<style>
.spacer { display:inline-block; width:20px; }
</style>
<p>There should be two good-looking arcs below.</p>
<div style="font-size:40px; line-height:100px;">
<span style="border:20px solid; border-radius:40px;">
<span class="spacer"></span><br><span class="spacer"></span>
</span>
</div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment