zkxs / simple-crosshair-overlay

A simple and performant crosshair overlay
GNU General Public License v3.0
16 stars 3 forks source link

Crosshair not aligned at startup #7

Closed DieSchoeneWolke closed 9 months ago

DieSchoeneWolke commented 11 months ago

Hey whenever I start the app the crosshair is not centered. When I align it with the shortcut it jumps up to the center. At first I thought that maybe it is aligned for 1080p or because of the display scaling that I use but when I run it with the default config and no scaling it is also not aligned on my 1080p Monitor.

Workaround Edit %appdata%\simple-crosshair-overlay\config\config.toml

zkxs commented 11 months ago

Thanks for the bug report! I'm pleased someone is getting some use out of this.

winit goes into detail as to how they handle UI scaling in their dpi module, and I think that I'm handling UI scaling correctly by using the PhysicalPosition / PhysicalSize types... but I might have missed something.

While I was digging around I noticed that my centering math doesn't work properly under certain edge cases, and I've fixed that in version 0.1.4. I did some testing on my primary monitor (1440p with 125% scaling) and my secondary monitor (1080p with 100% scaling) and both appear to be centering correctly under this update. Please give 0.1.4 a try and let me know if it solves your problem.

Finally... just a wild theory... but do you have the Windows taskbar on the top of your display? I can't help but wonder if that causes weird problems.

DieSchoeneWolke commented 11 months ago

Yes! I do use the taskbar on the top so that might be the case. And I'm really in love with your crosshair that I will recommend it to everyone because it's so lightweight and not a completely bloated electron app with 100MB RAM usage, 5 processes which noticeably introduces some lag on higher framerates while yours with the beautiful Rust programming language only needs one process and 1MB RAM. Thanks for the response and the very fast update!

zkxs commented 11 months ago

Yes! I do use the taskbar on the top so that might be the case.

Ah, I was hoping you wouldn't say that... because that means that 0.1.4 didn't fix this bug after all. I had to unlock my taskbar for the first time in years to reproduce the bug. It should be fixed in version 0.1.5. Let me know how it looks.

it's so lightweight and not a completely bloated electron app

Ha, you've described the exact reason I made this. I was searching for a crosshair overlay that wasn't some weird proprietary junk and most of the open-source stuff I was finding on GitHub was written in JavaScript. Except for DerKuehneKollege/center-dot which I actually quite liked... except the crosshair is 5x5 with no way to resize. After taking a look at the code for that and quickly deciding I don't like Qt, I figured I'd have a little fun and write something similar in Rust.

Anyways, glad someone out there appreciates performant software :)

zkxs commented 9 months ago

I believe this issue was resolved in the updates mentioned in the comments above, so I'm closing the issue. If you're still experiencing this problem please feel free to reopen it!