-
Notifications
You must be signed in to change notification settings - Fork 6
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
Incorrect transformation of arcs in edge cases #77
Comments
This was reported again in phetsims/ph-scale#222, and continues to be reported by QA. I realize that it's a "display only" problem, and doesn't impact usability. But it would be nice to address, so that's we're not spending QA/dev resources on the same issue repeatedly. |
This may be due to a sign error in EllitpicalArc.js, I should run a pixel comparison test and see if it shows any discrepancies. @jonathanolson please chime in if the sign change seems good to you: Index: js/segments/EllipticalArc.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/segments/EllipticalArc.js b/js/segments/EllipticalArc.js
--- a/js/segments/EllipticalArc.js (revision bc7e09afea97bab68aad30aeb0fd9e57bd4fd515)
+++ b/js/segments/EllipticalArc.js (date 1626210327688)
@@ -641,8 +641,8 @@
}
else if ( this._radiusX === this._radiusY ) {
// reduce to an Arc
- const startAngle = this._startAngle - this._rotation;
- let endAngle = this._endAngle - this._rotation;
+ const startAngle = this._startAngle + this._rotation;
+ let endAngle = this._endAngle + this._rotation;
// preserve full circles
if ( Math.abs( this._endAngle - this._startAngle ) === Math.PI * 2 ) { |
I ran a snapshot comparison with that delta, without
Everything else is clear. Let's try to narrow these down. |
I tested the top 3, natural selection, and neuron and couldn't see any differences anywhere. But I did notice many of these sims have keyboard navigation features. I'm inclined to push the fix and ask people to keep an eye out. |
I slacked dev-public:
@jonathanolson can you please review? |
In slack @pixelzoom said:
I replied: We have hypothesized that it was a display-only bug, but from the fix, it looks like it would affect anything that was using EllipticalArc.getNondegenerateSegments when (a) radiusX===radiusY and (b) the rotation is nonzero. I can only hope that no code was relying on the buggy behavior. I tested several sims that rendered differently with the fix, and couldn’t pinpoint it. |
I've tested in my sims that use ProbeNode, and this fix looks good. But I'm going to wait to close sim-specific issues until @jonathanolson has reviewed and closed this issue. |
Looks like a perfect fix, thank you! |
Thanks, closing. |
From phetsims/scenery-phet#488
Details include:
I'm mostly confirming that this is manifesting only as a display-only problem.
It looks like
Shape.transformed
is not behaving correctly for a certain class of transforms (depending on the exact scale/translation) for the probe shape. This is used for the display, but NOT in the hit testing.For instance a buggy case is the Shape:
Transforming with the matrix:
ends with the buggy case:
resulting in the bad touch area displayed:
The text was updated successfully, but these errors were encountered: