gwlucastrig / Tinfour

Delaunay and Constrained Delaunay Triangulations in Java, providing high-performance utilities for modeling surfaces with support for Lidar LAS files, Digital Elevation Models (DEM), finite element analysis, path planning, natural neighbor interpolation, and other applications of Triangulated Irregular Networks (TIN)
Apache License 2.0
158 stars 34 forks source link

TinfourDemo rendering is upscaled for `-Dsun.java2d.uiScale=2` #91

Open zdila opened 2 years ago

zdila commented 2 years ago

My display is a high resolution one and therefore I must run java with -Dsun.java2d.uiScale=2 to make UI text readable. Unfortunately this parameter also causes the rendering output to be upscaled. Interestingly if I start to zoom out then the upscaling starts to disappear, but after it re-renders it is back.

image

gwlucastrig commented 2 years ago

The TinfourViewer was intended as a proof-of-concept rather than a serious tool. So some of its features are limited. I'll have to add a font selection to its "View" options.

In the meantime, you can modify the code to suit your requirements. Go into MvComposite.java and look for "new Font". There are two places where the font is set to Arial 10 point. Increase the size as you see fit.

The change above will modify the vertex labels. If you want to change the text in the right-hand panel, look for the strings "html" and "small". If you remove the small specification, you'll get larger text.

On Fri, Oct 14, 2022, 3:02 AM Martin Ždila @.***> wrote:

My display is a high resolution one and therefore I must run java with -Dsun.java2d.uiScale=2 to make UI text readable. Unfortunately this parameter also causes the rendering output to be upscaled. Interestingly if I start to zoom out then the upscaling starts to disappear, but after it re-renders it is back.

[image: image] https://user-images.githubusercontent.com/636095/195783004-d453ef13-dabd-425f-a150-bebeec75333a.png

— Reply to this email directly, view it on GitHub https://github.com/gwlucastrig/Tinfour/issues/91, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWJDYNS7IEEWW4RJDTC5TDWDEARPANCNFSM6AAAAAARE6JIGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

zdila commented 2 years ago

I understand. Anyway the problem is not just with the fonts, but all the graphics ind the output view (lines, interpolated raster). If I will find a time I will try to play with it :-).

zdila commented 2 years ago

This is quick patch, but scaling needs to be probably applied on many more places.

scale.diff.gz

gwlucastrig commented 2 years ago

Thanks. It see the approach. It affects line thickness, font size, the size of vertex symbols. I will play with the when I get c chance.

On Fri, Oct 14, 2022, 9:49 AM Martin Ždila @.***> wrote:

This is quick patch, but scaling needs to be probably applied on many more places.

scale.diff.gz https://github.com/gwlucastrig/Tinfour/files/9786909/scale.diff.gz

— Reply to this email directly, view it on GitHub https://github.com/gwlucastrig/Tinfour/issues/91#issuecomment-1279036513, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEWJDYM5HANIDUCZWSPZAHLWDFQGLANCNFSM6AAAAAARE6JIGM . You are receiving this because you commented.Message ID: @.***>