Bug 174831 - Dragged links are blurry on 1x displays.
Summary: Dragged links are blurry on 1x displays.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-25 13:33 PDT by Per Arne Vollan
Modified: 2017-07-25 15:49 PDT (History)
4 users (show)

See Also:


Attachments
Patch (1.88 KB, patch)
2017-07-25 13:41 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2017-07-25 13:33:54 PDT
When I drag a link from a 2x display to a 1x display, the text in the drag image is blurry.
Comment 1 Per Arne Vollan 2017-07-25 13:34:20 PDT
<rdar://problem/33519698>
Comment 2 Per Arne Vollan 2017-07-25 13:41:38 PDT
Created attachment 316388 [details]
Patch
Comment 3 Simon Fraser (smfr) 2017-07-25 13:47:31 PDT
Comment on attachment 316388 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=316388&action=review

> Source/WebCore/platform/mac/DragImageMac.mm:293
> +    // To work around blurry drag images on 1x displays, make the width and height a multiple of 2.
> +    // FIXME: remove this workaround when <rdar://problem/33059739> is fixed.
> +    boundingRect.setWidth((static_cast<int>(boundingRect.width()) / 2) * 2);
> +    boundingRect.setHeight((static_cast<int>(boundingRect.height() / 2) * 2));

Is this a user-visible change, or does it just add transparent pixels? Does it affect alignment of the image with the pointer?
Comment 4 Per Arne Vollan 2017-07-25 14:06:07 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 316388 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=316388&action=review
> 
> > Source/WebCore/platform/mac/DragImageMac.mm:293
> > +    // To work around blurry drag images on 1x displays, make the width and height a multiple of 2.
> > +    // FIXME: remove this workaround when <rdar://problem/33059739> is fixed.
> > +    boundingRect.setWidth((static_cast<int>(boundingRect.width()) / 2) * 2);
> > +    boundingRect.setHeight((static_cast<int>(boundingRect.height() / 2) * 2));
> 
> Is this a user-visible change, or does it just add transparent pixels? Does
> it affect alignment of the image with the pointer?

Do you mean if this changes the alignment of the memory address of the image data?

Thanks for reviewing!
Comment 5 Simon Fraser (smfr) 2017-07-25 14:07:39 PDT
Comment on attachment 316388 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=316388&action=review

>>> Source/WebCore/platform/mac/DragImageMac.mm:293
>>> +    boundingRect.setHeight((static_cast<int>(boundingRect.height() / 2) * 2));
>> 
>> Is this a user-visible change, or does it just add transparent pixels? Does it affect alignment of the image with the pointer?
> 
> Do you mean if this changes the alignment of the memory address of the image data?
> 
> Thanks for reviewing!

No, i mean the position of the drag image relative to the mouse pointer.
Comment 6 Per Arne Vollan 2017-07-25 14:28:38 PDT
(In reply to Simon Fraser (smfr) from comment #5)
> Comment on attachment 316388 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=316388&action=review
> 
> >>> Source/WebCore/platform/mac/DragImageMac.mm:293
> >>> +    boundingRect.setHeight((static_cast<int>(boundingRect.height() / 2) * 2));
> >> 
> >> Is this a user-visible change, or does it just add transparent pixels? Does it affect alignment of the image with the pointer?
> > 
> > Do you mean if this changes the alignment of the memory address of the image data?
> > 
> > Thanks for reviewing!
> 
> No, i mean the position of the drag image relative to the mouse pointer.

Ah, yes, I believe it does affect the alignment with the pointer, since the image size is used in this calculation.
Comment 7 Simon Fraser (smfr) 2017-07-25 14:58:32 PDT
That's bad, then.
Comment 8 Per Arne Vollan 2017-07-25 15:21:07 PDT
Thanks for reviewing!
Comment 9 WebKit Commit Bot 2017-07-25 15:49:00 PDT
Comment on attachment 316388 [details]
Patch

Clearing flags on attachment: 316388

Committed r219891: <http://trac.webkit.org/changeset/219891>
Comment 10 WebKit Commit Bot 2017-07-25 15:49:01 PDT
All reviewed patches have been landed.  Closing bug.