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

Improve WIA Cropping #4223

Merged
merged 5 commits into from
Nov 16, 2023
Merged

Improve WIA Cropping #4223

merged 5 commits into from
Nov 16, 2023

Conversation

adghayes
Copy link
Collaborator

@adghayes adghayes commented Nov 16, 2023

Overview

#4025

Demo Video or Screenshot

Before After
Screen Shot 2023-11-13 at 4 42 03 PM Screen Shot 2023-11-16 at 2 03 45 PM
Screen Shot 2023-11-13 at 4 40 33 PM Screen Shot 2023-11-16 at 1 37 11 PM

Testing Plan

Manual mostly, updated snapshots / fixtures.

Checklist

  • I have added logging where appropriate to any new user actions, system updates such as file reads or storage writes, or errors introduced.
  • I have added a screenshot and/or video to this PR to demo the change
  • I have added the "user_facing_change" label to this PR to automate an announcement in #machine-product-updates

top: 2,
top: 1,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We were cropping a little high on the VxBallots, see difference between highlight and desired area:

Screen Shot 2023-11-13 at 4 42 13 PM

The cropping too low is dealt with in the interpreter. The above is correct - it says 1 and we want 1. That off-by-one issue is in the interpreter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not necessary but thought I'd make it consistent.

Comment on lines 35 to +38
let width: GridUnit = grid_layout.option_bounds_from_target_mark.left
+ grid_layout.option_bounds_from_target_mark.right
+ 1;
+ grid_layout.option_bounds_from_target_mark.right;
let height: GridUnit = grid_layout.option_bounds_from_target_mark.top
+ grid_layout.option_bounds_from_target_mark.bottom
+ 1;
+ grid_layout.option_bounds_from_target_mark.bottom;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Here's the off-by-one issue. We're adding in 1 to the width and the height, in addition to the top + bottom or left + right specified by the gridLayouts. I imagine the original thought here was to account for the size of the bubble itself? But we don't need to do that, the measurements are from the center of the bubble in all directions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird, I don't know why we would have done that! Nice catch

@adghayes adghayes requested a review from jonahkagan November 16, 2023 19:09
@adghayes adghayes marked this pull request as ready for review November 16, 2023 19:10
Comment on lines 35 to +38
let width: GridUnit = grid_layout.option_bounds_from_target_mark.left
+ grid_layout.option_bounds_from_target_mark.right
+ 1;
+ grid_layout.option_bounds_from_target_mark.right;
let height: GridUnit = grid_layout.option_bounds_from_target_mark.top
+ grid_layout.option_bounds_from_target_mark.bottom
+ 1;
+ grid_layout.option_bounds_from_target_mark.bottom;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Weird, I don't know why we would have done that! Nice catch

@adghayes adghayes merged commit f8b1a12 into main Nov 16, 2023
@adghayes adghayes deleted the drew/write-in-view branch November 16, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants