fix(🐛): compare isEdge against the far edges of the rect - #4028
Open
dennytosp wants to merge 1 commit into
Open
Conversation
isEdge was extracted in Shopify#500 from an inline check whose rect was always at the origin, so `pos.x === width` happened to be right there. Generalising it to an SkRect only carried the near edges over: the far ones still compare against the rect's width and height instead of x + width and y + height, so for any rect not at the origin the function reports two edges that are inside the rect and misses the two real ones.
dennytosp
force-pushed
the
fix/is-edge-right-and-bottom-edges
branch
from
August 24, 2026 15:11
98bf54c to
fcdec72
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
isEdgeis exported from the package root (dom/nodes→datatypes→Rect) and compares the far edges against the rect'swidth/heightrather thanx + width/y + height:It is inconsistent with itself — the near edges are offset by
b.x/b.y, the far ones are not. The history explains why: #500 extracted it from an inline check in the Aurora example,whose rect was always
Skia.XYWHRect(0, 0, width, height). At the origin the offset makes no difference, so only half the generalisation was needed and only half got written.For a rect away from the origin it reports two edges that fall inside the rect and misses the two real ones. For
rect(10, 20, 100, 50)the right edge is atx = 110, but the current code answerstrueforx = 100andfalseforx = 110.Test added to
Geometry.spec.ts; it fails onmainat the first far-edge assertion.