LibreCAD / LibreCAD

LibreCAD is a cross-platform 2D CAD program written in C++17. It can read DXF/DWG files and can write DXF/PDF/SVG files. It supports point/line/circle/ellipse/parabola/spline primitives. The user interface is highly customizable, and has dozens of translations.

Home Page:http://librecad.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microscopic Mouse Cursor on HiRes Display

GSStnb opened this issue · comments

Expected behavior

LC retains system mouse curor size or cursor size is configuarble within LC.

Observed behavior

The mouse cursor in LC is a fraction of the system mouse cursor.

Steps to reproduce or sample file

Set system mouse cursor to maximum size
Move mouse from desktop panel to LC application window.
Mouse cursor changes size becoming much, much smaller (and hard to find in the drawing window).

Operating System and LibreCAD version info

Version: 2.2.1_alpha-424-g806e61d0
Compiler: GNU GCC 11.4.0
Compiled on: Apr 25 2024
Qt Version: 5.15.3
Boost Version: 1.74.0
System: Debian GNU/Linux trixie/sid
Other:
Cinnamon desktop
Display is 3840x2160

Could someone help me confirm this issue?

I am using standard 1920x1080 screens here.

Here area couple of screen capture showing the difference (zoomed 200%):
MouseCursorSystem
MouseCursor-LC
The system setting for the mouse cursor is just Small to Large. The panel height is 40 pixels, so the system mouse cursor is +/- 24. In LC it is maybe 16 pixels.

I did some poking around the source and I found the following in /LibreCAD-master/librecad/src/ui/qg_graphicview.cpp:

#if (defined (Q_OS_WIN32) || defined (Q_OS_WIN64))
    #define CURSOR_SIZE 16
#else
    #define CURSOR_SIZE 15
#endif

Am I correct in my thinking that in Windows the system cursor size is used, but in Linux and MacOS it would be fixed at 15 pixels? The Qt documentation lists, among a whole bunch of additionsl OSes, "Q_OS_LINUX" and "Q_OS_MACOS"

Cursors are controlled by Qt. We can set the pixel sizes, but for cursors (and other GUI items, except drawing in coordinated), the pixels are in device independent units for Qt, meaning Qt will scale them by a factor, if high dpi device is detected.
So, the size 16 may mean 32 actual pixels on high dpi.

It helps to play with this value still