Render a badge on system preview images
<rdar://problem/39615154>
Created attachment 338503 [details] Patch
Comment on attachment 338503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338503&action=review > Source/WebCore/rendering/RenderTheme.cpp:1374 > + auto roundedMarkerRect = FloatRoundedRect { markerRect, { 8, 8 }, { 8, 8 }, { 8, 8 }, { 8, 8 } }; There is a single-float uniform radii constructor
Comment on attachment 338503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338503&action=review > Source/WebCore/rendering/RenderTheme.cpp:1360 > +void RenderTheme::paintSystemPreviewBadge(Image& image, const PaintInfo& paintInfo, const FloatRect& rect) const Image& > Source/WebCore/rendering/RenderTheme.cpp:1375 > + auto markerRect = FloatRect {rect.x() + rect.width() - 24, rect.y() + 8, 16, 16 }; > + auto roundedMarkerRect = FloatRoundedRect { markerRect, { 8, 8 }, { 8, 8 }, { 8, 8 }, { 8, 8 } }; > + auto color = Color { 255, 0, 0 }; How do these hardcoded values work in scaled context?
Comment on attachment 338503 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=338503&action=review >> Source/WebCore/rendering/RenderTheme.cpp:1375 >> + auto color = Color { 255, 0, 0 }; > > How do these hardcoded values work in scaled context? Assuming the badge should scale up, they'll be fine!
Committed r230872: <https://trac.webkit.org/changeset/230872>
(In reply to Tim Horton from comment #5) > Comment on attachment 338503 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=338503&action=review > > >> Source/WebCore/rendering/RenderTheme.cpp:1375 > >> + auto color = Color { 255, 0, 0 }; > > > > How do these hardcoded values work in scaled context? > > Assuming the badge should scale up, they'll be fine! Yep, the badge should scale with the image. The one we'll implement for Apple is specified to be 10% of the image height.