Skip to content
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

Remove a bunch more Closure #2552

Merged
merged 17 commits into from
Jun 7, 2019
Merged

Remove a bunch more Closure #2552

merged 17 commits into from
Jun 7, 2019

Conversation

NeilFraser
Copy link
Contributor

Each commit may be viewed individually.

Copy link
Collaborator

@rachel-fenichel rachel-fenichel left a comment

Choose a reason for hiding this comment

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

LGTM after a few ordering nits.

core/scrollbar.js Outdated Show resolved Hide resolved
core/workspace_comment_svg.js Outdated Show resolved Hide resolved
core/workspace_svg.js Outdated Show resolved Hide resolved
core/ws_comment_events.js Outdated Show resolved Hide resolved
Search and replace for userAgent didn’t take into account alphabetic ordering.
Also some line wraping.
Old: a box object with two coordinate objects, each with two numbers.
New: a box object with four numbers.

The old system would make sense if there was a reason to group the top-left and bottom-right coordinates.  But in our code we only pulled out top/bottom/left/right numbers.

New code is simpler and faster.
Search and replace of a name strikes again.
Previously it returned x,y,width,height.  Returning top,bottom,left,right results in simpler code, both in this function and in downstream callers.

This commit makes the minumum change to the metrics_test.  I’m happy to change the test’s data if that makes more sense.
Also move SVG_NS and HTML_NS properties.
And fix provide/require mixup.
Instead of top/left/height/width.  Given our uses of Rect, it makes the math slightly simpler.

This is a setup for using Rect in other places.  Currently it is only used to describe delete areas.
@NeilFraser
Copy link
Contributor Author

Here's a summary of the rectangle changes that span across four commits. Previously we were using three different types of data structures to describe rectangles:

  1. Edges: top, bottom, left, right.
  2. Size: top, left, height, width.
  3. Corners: top-left coordinate, bottom-right coordinate.

As a result of these commits, we are now using only option 1. This means that Blockly.utils.Rect is used in more places.

core/comment.js Outdated Show resolved Hide resolved
core/field_angle.js Outdated Show resolved Hide resolved
@rachel-fenichel
Copy link
Collaborator

Note: provides were fixed in the following commit.

LGTM

@NeilFraser NeilFraser merged commit 0213de1 into develop Jun 7, 2019
@NeilFraser NeilFraser deleted the closure-die-die-die branch June 7, 2019 17:33
@BeksOmega
Copy link
Collaborator

By the way based on my conversation with Amber, I think moving svg utils into utils.dom may break a not insignificant amount of people.

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.

None yet

3 participants