Custom cursors and high dpi (Windows and MacOS testers needed)

A forum for research and development of the user interface of FreeCAD

Moderator: agryson

openBrain
Posts: 4870
Joined: Fri Nov 09, 2018 5:38 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby openBrain » Sat Jul 25, 2020 8:54 am

vanuan wrote:
Sat Jul 25, 2020 8:50 am
I mean that not all icons are the same. Some touch the crosshair, some don't. Compare line and rectangle cursors for example.
:? Here all cursors always have the symbol bottom right of crosshair. Which seems sensible. ;)

EDIT:
cursor.png
cursor.png (1.14 KiB) Viewed 554 times
mikeprice99
Posts: 79
Joined: Sat Jun 27, 2020 9:06 am
Location: Dorset, England

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby mikeprice99 » Sat Jul 25, 2020 10:51 am

If you do want the cursors recreated in svg, it's now taking me less than 5 minutes per cursor.
Here's a few attached (If you open up the file in an xml editor you'll realise that there is very little difference between each one.)
If you want to view them large scale, change height="64" width="64" to viewBox="0 0 64 64" and drop them on your web browser.
Attachments
cursor_line.svg
(548 Bytes) Downloaded 14 times
cursor_slot.svg
(551 Bytes) Downloaded 12 times
cursor_rect.svg
(553 Bytes) Downloaded 11 times
User avatar
vanuan
Posts: 465
Joined: Wed Oct 24, 2018 9:49 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby vanuan » Sat Jul 25, 2020 2:31 pm

openBrain wrote:
Sat Jul 25, 2020 8:54 am
vanuan wrote:
Sat Jul 25, 2020 8:50 am
I mean that not all icons are the same. Some touch the crosshair, some don't. Compare line and rectangle cursors for example.
:? Here all cursors always have the symbol bottom right of crosshair. Which seems sensible. ;)
For the line it's bottom right of the center, for rectangle it's bottom right of the crosshair
User avatar
vanuan
Posts: 465
Joined: Wed Oct 24, 2018 9:49 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby vanuan » Sun Jul 26, 2020 2:19 am

mikeprice99 wrote:
Sat Jul 25, 2020 10:51 am
If you do want the cursors recreated in svg, it's now taking me less than 5 minutes per cursor.
Great! Incorporated in https://github.com/FreeCAD/FreeCAD/pull/3712
mikeprice99
Posts: 79
Joined: Sat Jun 27, 2020 9:06 am
Location: Dorset, England

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby mikeprice99 » Sun Jul 26, 2020 7:32 am

vanuan wrote:
Sun Jul 26, 2020 2:19 am
Great! Incorporated in https://github.com/FreeCAD/FreeCAD/pull/3712
Thanks - its very rewarding for contributors like me to see our efforts quickly adopted.
Meanwhile, I note your PR uses the older version for the slot svg. Note in the commit diff how large and bloated it is.

The problem with the SVGs generated by Inkscape and other graphics apps are:
1/ Inclusion of unused data (eg the slot svg contains 8 unused gradient definitions)
2/ Unnecessary transformations. eg an element is drawn at one location then moved to the correct position. (eg transform="translate(0,-988.36218)">)
3/ Vector locations use ridiculous floating point numbers: we're playing with a 64 x 64 grid - yet a simple position is given as (eg cx="225.26402" )
4/ Include unnecessary element ids: elements only need id if they need to be referenced by other elements, but I use them to make the source readable. For instance I give an id crosshair for the actual crosshair definition.

I'll now do a few more and upload them here.
openBrain
Posts: 4870
Joined: Fri Nov 09, 2018 5:38 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby openBrain » Sun Jul 26, 2020 8:12 am

vanuan wrote:
Sun Jul 26, 2020 2:19 am
Great! Incorporated in https://github.com/FreeCAD/FreeCAD/pull/3712
Could you please interactively rebase your branch and squash/fixup your commits so they are presented in a logical condensed way (eg. you can merge all the commits that handles change to SVG icons) ?
Could you also indicate your PR isn't ready to merge yet so maintainers doesn't consume time looking at it ?
User avatar
vanuan
Posts: 465
Joined: Wed Oct 24, 2018 9:49 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby vanuan » Sun Jul 26, 2020 11:09 am

openBrain wrote:
Sun Jul 26, 2020 8:12 am
vanuan wrote:
Sun Jul 26, 2020 2:19 am
Great! Incorporated in https://github.com/FreeCAD/FreeCAD/pull/3712
Could you please interactively rebase your branch and squash/fixup your commits so they are presented in a logical condensed way (eg. you can merge all the commits that handles change to SVG icons) ?
Could you also indicate your PR isn't ready to merge yet so maintainers doesn't consume time looking at it ?
I can squash all the commits if it would be easier to review. It is ready to review and merge, nothing is broken.
openBrain
Posts: 4870
Joined: Fri Nov 09, 2018 5:38 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby openBrain » Sun Jul 26, 2020 11:21 am

vanuan wrote:
Sun Jul 26, 2020 11:09 am
I can squash all the commits if it would be easier to review.
I didn't have a close look. Maybe git commit fdfda05 and git commit a3af118 that add implementation can be kept separated.
git commit 7720654 can be merged as fixup of commit it fixes.
All others changing to SVG can be squashed IMO.
It is ready to review and merge, nothing is broken.
It's definitely not ready. Not all symbols are ported to SVG, this is totally partial. While 0.19 is coming closer to release every day, this is really not sensible to merge such an unfinished PR.
User avatar
vanuan
Posts: 465
Joined: Wed Oct 24, 2018 9:49 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby vanuan » Sun Jul 26, 2020 11:41 am

openBrain wrote:
Sun Jul 26, 2020 11:21 am
Not all symbols are ported to SVG, this is totally partial
Please, define "all"
openBrain
Posts: 4870
Joined: Fri Nov 09, 2018 5:38 pm

Re: Custom cursors and high dpi (Windows and MacOS testers needed)

Postby openBrain » Sun Jul 26, 2020 11:49 am

Polyline, arc, circle, ellipse, ... cursors are still defined as XPM.