GithubHelp home page GithubHelp logo

Centered xhair? about crossover HOT 3 CLOSED

lacymorrow avatar lacymorrow commented on July 17, 2024
Centered xhair?

from crossover.

Comments (3)

arielsasson avatar arielsasson commented on July 17, 2024

UPDATE: I was curious and did a print screen and zoomed in with paint, and noticed the + crosshair (the basic one) is only one pixel thick. In a screen with even resolution dimensions, such as 1920*1080 you should use even amounts of pixels in the thickness of the lines, otherwise it will not be perfectly centered (this is due pixel 0 is undefined in the screen). I guess you could use 2 pixels for even dimensions. Also, I have been able to perfectly center the basic dot -I do this in Rust and it's very clear because the game itsef provides a barely bigger centered dot in a few situations (I just guess your dot's dimensions are even when size setting is at 100%). Then, when I switch to the basic + crosshair, the center dot happens to be in the pixel (960,540) so I guess the fix for this would be adding two more lines so that de center dot are the pixels (960,540) , (961,540) , (960,541) , (961,541). Generalizing to other cases would mean adding another line to the right of the vertical line, and another line below the horizontal one. Also, a "no center dot" option would be lovely 👍 . Thanks and hope this helps in any way.

from crossover.

lacymorrow avatar lacymorrow commented on July 17, 2024

Sorry for the month-late reply, I appreciate the research you've done.

It's true because of the nature of pixels in a display, there is no real center pixel, only a pair. When faced with the options of having a 2px-wide crosshair or a 1px-wide crosshair that is only centered "sometimes" (when the size of the sight allows it), I chose the latter because I wanted the thinnest possible crosshair. It could have been the wrong choice.

Due to the way Chrome renders DOM and canvas elements, sub-pixel rendering isn't possible BUT I think it should be possible using images (rather than drawing the dot/crosshair myself), so hopefully you can expect a PR in the next week or so.

There IS an option to turn off the crosshair/center dot, the "off" button next to them.
image

from crossover.

repo-ranger avatar repo-ranger commented on July 17, 2024

⚠️ This has been marked to be closed in 7 days.

from crossover.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.