Opened 8 months ago
Closed 6 months ago
#22011 closed defect (bug) (fixed)
Janky behavior with imageEdit.scaleChanged() in inline image editor
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.4.2 |
| Severity: | normal | Keywords: | dev-feedback has-patch |
| Cc: |
Description
As noted in ticket:21391:39, there's some janky behavior when tabbing between the width and height scaling values in the inline image editor. Tabbing between values appears to increment the values down 1 unit at a time. Short screencast to illustrate: http://screencast.com/t/tPiq9KlYVzzj
My best guess is something with the imageEdit logic in image-edit.js. Javascript is not my forte.
I reproduced in FF15 on trunk and @ocean90 in Chrome on 3.4.2.
Attachments (1)
Change History (9)
comment:2
DrewAPicture — 7 months ago
- Keywords punt added
You know... I bet it's a problem with rounding. Looks like it's probably floor-ing, which will keep ticking numbers down if it doesn't divide evenly. Just tried it on a square image and it didn't do that, but can reproduce on others. Not sure about a punt - does feel kind of buggy.
SergeyBiryukov — 6 months ago
comment:5
SergeyBiryukov — 6 months ago
- Keywords has-patch added
comment:6
SergeyBiryukov — 6 months ago
this.intval() removes the fractional part, which leads to unwanted decrementing.
Math.round() gives more accurate results and doesn't trigger unwanted incrementing in my testing.
comment:7
SergeyBiryukov — 6 months ago
To reproduce:
- Click "Edit Image" on a non-square image (e.g. 1000 × 662).
- If the width is 1000px, change that to a non-round number (e.g. 999 × 661).
- Keep tabbing between the width and height values. You'll see 998 × 661, 996 × 660, 995 × 659, 993 × 658, etc.

The scaling ratio works, there's just some weirdness with moving between the values. I propose we look at this in the next cycle.