Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Visual size of Square ??  (Read 1556 times)

0 Members and 1 Guest are viewing this topic.

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Visual size of Square ??
« on: July 11, 2015, 03:14:43 pm »
If I create RectangleShape(10.5001f, 10.5001f) - see on monitor square with size of 11px width and 10px height.
Created RenderWindow with size 800x800.

Why not 11px / 11px square.
If I set 10.501f / 10.501f - got square 11 / 11.
But me need 4 signs precision after point.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Visual size of Square ??
« Reply #1 on: July 11, 2015, 03:18:41 pm »
Because of OpenGL rasterisation.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
« Last Edit: July 11, 2015, 03:28:53 pm by Jesper Juhl »

Redee

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Visual size of Square ??
« Reply #3 on: July 11, 2015, 03:29:46 pm »
Thats why need store 2 sizes of Object >>
1 - logic math
2 - whole number without signs after point to Display

Using f.e. >> floor(x + 0.5f);