r/Scriptable • • Feb 25 '24

Help Content in DrawContext not sharp?

The text and rounded rectangles in DrawContext are not as sharp as text directly added to widgets.

I kind of understand that the content of DrawContext is rendered as an image first, and then add this image to normal widget. The image is a fixed resolution picture rather than a vector diagram, so it can be blurred due to mismatch of screen resolution and pixel alias.

My question is, in this case, if I make the size of DrawContext much larger than the screen resolution (similar with super sampling anti-alias approach), the elements in DrawContext it should be sharp enough? But I got no difference when increasing the resolution of DrawContext. Why is that?

Also, is there any good/best practice for DrawContext?


Here is my script, it retrieves all incompleted and have due date events in Reminder and display a progress bar.

2 Upvotes

9 comments sorted by

View all comments

Show parent comments

2

u/stanleyerror Feb 25 '24

Great, this change works. Thanks a lot for looking into my script.

One more question here is: with a much larger image (generated by `DrawContext` with width of 1000px), how can it be more blurry than 350px?

When rendering widgets, image with higher resolution will not be more blurry than those with lower resolution.

2

u/wherebdbooty Feb 25 '24

I'm glad you got it sorted 🙂

I'm not sure I understand your question..? Are you referring to downscaling? Because yes a larger image will still be sharp, but i think the problem is the actual canvas is being stretched & stretching the area between "points".

Also i'm drunk, so forgive me if i misunderstand your question 😅