Skip to content

Add new bounding-box helpers in Util to reduce code duplication #19713

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

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 23, 2025

Currently we have a Util-helper for computing the bounding-box of a Bézier curve, however for simple points and rectangles we repeat virtually identical code in many spots throughout the code-base.

  • Introduce new Util.pointBoundingBox and Util.rectBoundingBox helpers.

  • Remove the "fallback" from Util.bezierBoundingBox and only support passing in a minMax-array, since there's only a single call-site using the other format and it could be easily updated.

@Snuffleupagus Snuffleupagus marked this pull request as draft March 23, 2025 17:29
@mozilla mozilla deleted a comment from moz-tools-bot Mar 23, 2025
@mozilla mozilla deleted a comment from moz-tools-bot Mar 23, 2025
Currently we have a `Util`-helper for computing the bounding-box of a Bézier curve, however for simple points and rectangles we repeat virtually identical code in many spots throughout the code-base.

 - Introduce new `Util.pointBoundingBox` and `Util.rectBoundingBox` helpers.

 - Remove the "fallback" from `Util.bezierBoundingBox` and only support passing in a `minMax`-array, since there's only a single call-site using the other format and it could be easily updated.
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/01fb527ad1cc8d1/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/01fb527ad1cc8d1/output.txt

Total script time: 29.46 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@Snuffleupagus Snuffleupagus marked this pull request as ready for review March 23, 2025 20:48
Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Snuffleupagus Snuffleupagus merged commit fceaab8 into mozilla:master Mar 24, 2025
9 checks passed
@Snuffleupagus Snuffleupagus deleted the Util-minMax-methods branch March 24, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants