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

Author Topic: Shapes not scaling properly with resized window  (Read 2720 times)

0 Members and 1 Guest are viewing this topic.

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Shapes not scaling properly with resized window
« on: April 17, 2008, 10:09:22 pm »
I'm using the shape class and it looks good; but if I draw a line using the static line function, the line does not scale properly if the user resizes the window (as all the other drawables do).
If this was fixed recently, it's possible my build is not up-to-date enough.

If it's somehow relevant, here's a code snippet of what I'm doing each frame:

Code: [Select]

sf::Shape gridLine;

while (fLeftScreenY < fLeftScreenYEnd)
{
gridLine = sf::Shape::Line(0.0f, fLeftScreenY, (float)v2iWinSize.x, fLeftScreenY - fHalfWinSizeX, 1, gridColor);
m_pRenderWindow->Draw(gridLine);

fLeftScreenY += fTileSizeY;
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Shapes not scaling properly with resized window
« Reply #1 on: April 18, 2008, 03:12:45 am »
There's not reason it wouldn't work, the code is common to all drawables. I suspect your variables to be in window coordinates rather than in view coordinates, which would explain the result.
Laurent Gomila - SFML developer

quasius

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Shapes not scaling properly with resized window
« Reply #2 on: April 18, 2008, 06:00:28 pm »
Quote from: "Laurent"
There's not reason it wouldn't work, the code is common to all drawables. I suspect your variables to be in window coordinates rather than in view coordinates, which would explain the result.


Yep, I was doing something retarded.  Apologies.