-
Notifications
You must be signed in to change notification settings - Fork 715
[css-borders-4] Interpolation of corner-shape
superellipsis
#11608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
corner-shape
superellipsis
This was referenced Jan 30, 2025
smfr
added a commit
to smfr/squircle-testbed
that referenced
this issue
Mar 30, 2025
According to something like w3c/csswg-drafts#11608
Visualization using the above (with some tweaks): |
The CSS Working Group just discussed
The full IRC log of that discussion<TabAtkins> noamr: this shoudln't be contentious<TabAtkins> noamr: let me show how it interpolates <TabAtkins> noamr: the interpolation takes the "half corner", th emiddle point, put it on the diagonal line and interpolate *that*. work backwards to get the superellipse parameter <TabAtkins> noamr: otherwise any interpolation in the paramter space itself would spend too much time in the extreme values <fantasai> TabAtkins: This does sound like the most reasonable interpolation method <TabAtkins> astearns: any indication from Simon? <TabAtkins> noamr: he did this visualization. <TabAtkins> noamr: everything i'm presenting here I worked together with Simon <TabAtkins> ack <astearns> ack TabAtkins <TabAtkins> fantasai: TAb, you mentioned the "effectively square" is 10 or so on both sides <TabAtkins> fantasai: above 10 <TabAtkins> fantasai: it basically doesn't do much? <TabAtkins> noamr: it's basically equivlanent unless your screen is enormous <TabAtkins> fantasai: should we declare that 10 gets rounded to a sharp corner? <TabAtkins> fantasai: so the CSS range is effectively -10 to 10? <TabAtkins> astearns: if your shape is very large you might get a jump <TabAtkins> noamr: shouldn't have it as part of interpolation <TabAtkins> noamr: the animation would appear to be faster in the middle if we did that <TabAtkins> noamr: in the current chrome prototype we *do* clamp to 10/-10, it makes the math easier <TabAtkins> noamr: but not sure it's useful in the specs <TabAtkins> fantasai: the reason it might be useful is, it's harder for the authro to know that to get an actually sharp corner they need to use a much bigger value <fantasai> TabAtkins: The interpolation behavior defined here is that we don't interpolate the parameter, we interpolate the diagonal line. <fantasai> TabAtkins: so you get a linear interpolation through the diagonal space <fantasai> TabAtkins: so you get a visually smooth value instead of changing speed <fantasai> fantasai: Would it make sense to make that the parameter? <fantasai> TabAtkins: No, because then squircles and other common values would be weird numbers. <TabAtkins> noamr: yeah, round is sqrt(2)/2 <TabAtkins> astearns: any other comments/question? <TabAtkins> astearns: so proposed is we interpolate linearly across the corner diagonal and compute the parameter backwards from that <TabAtkins> astearns: objection? <TabAtkins> RESOLVED: interpolate linearly across the corner diagonal and compute the parameter backwards from that |
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Apr 3, 2025
Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 3940596 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 3940596
aarongable
pushed a commit
to chromium/chromium
that referenced
this issue
Apr 3, 2025
Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Apr 3, 2025
Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 3940596 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 3940596 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117}
chromium-wpt-export-bot
pushed a commit
to web-platform-tests/wpt
that referenced
this issue
Apr 3, 2025
Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 3940596 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 3940596 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117}
ChunMinChang
pushed a commit
to ChunMinChang/gecko-dev
that referenced
this issue
Apr 7, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829
i3roly
pushed a commit
to i3roly/firefox-dynasty
that referenced
this issue
Apr 8, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this issue
Apr 8, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fsopera.com CC=pdrchromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthalchromium.org> Reviewed-by: Fredrik Söderquist <fsopera.com> Cr-Commit-Position: refs/heads/main{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829 UltraBlame original commit: 87d46cad4a23d8628bdf2e9ae278a8f657553c62
globau
pushed a commit
to globau/firefox-test
that referenced
this issue
Apr 8, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this issue
Apr 8, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fsopera.com CC=pdrchromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthalchromium.org> Reviewed-by: Fredrik Söderquist <fsopera.com> Cr-Commit-Position: refs/heads/main{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829 UltraBlame original commit: 87d46cad4a23d8628bdf2e9ae278a8f657553c62
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this issue
Apr 8, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fsopera.com CC=pdrchromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthalchromium.org> Reviewed-by: Fredrik Söderquist <fsopera.com> Cr-Commit-Position: refs/heads/main{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829 UltraBlame original commit: 87d46cad4a23d8628bdf2e9ae278a8f657553c62
jamienicol
pushed a commit
to jamienicol/gecko
that referenced
this issue
Apr 9, 2025
Automatic update from web-platform-tests Corner-shape: interpolation Interpolate superellipse values as per CSSWG resolution: w3c/csswg-drafts#11608 (comment) The values are converted to a linear range by converting the superellipse to its half corner's X, which interpolates on a diagonal line across the corner. The simplified formula (see w3c/csswg-drafts#12033) is 0.5^(0.5^(param)), and adjusted to be symmetrical for convex/concave. Implemented all of this in CSSSuperellipseInterpolationType, and added an appropriate corner-shape-interpolation test. R=fs@opera.com CC=pdr@chromium.org Bug: 394059605 Change-Id: I552ace6cce40b5e41afd300df1ddcb4d2082c7a2 Fixed: 394059605 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6425902 Commit-Queue: Noam Rosenthal <nrosenthal@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/main@{#1442117} -- wpt-commits: 90fcc6fd8576c63aa20e9e63ebc840ad61d27b48 wpt-pr: 51829
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Follow up on #10993
We are defining
corner-shape
as different variations onsuperellipse(exponent)
, which allows us to animate the exponent.However, animating the exponent linearly would result in varying velocity - high velocity when concave, and low velocity when convex.
The visual result would be, for example, that a linear animation between
notch
andstraight
would start very fast and would seem like it's slowing down towardsstraight
.Proposing to use the following formula (also used in the draft) to balance this: intersect the superellipse with the given
k
, with a diagonal straight line that slices the corner. This would make it so that a "linear" animation would be linear from the point of view of the center of the curve.The formula looks like this (
k
is the exponent):This formula conveniently maps a
k
between 0 and infinity to a number between 0 and 1, and we can decide that 0 always maps for 0 and infinity also maps to 1.The text was updated successfully, but these errors were encountered: