Skip to content
This repository
Browse code

Fixed the sf::Font texture corruption bug for big character sizes

  • Loading branch information...
commit 49f37ee8b309076ef151ce2f7d8f8429eeb0c7fb 1 parent 109d914
Laurent Gomila authored

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. +4 3 src/SFML/Graphics/Font.cpp
7 src/SFML/Graphics/Font.cpp
@@ -521,9 +521,10 @@ IntRect Font::findGlyphRect(Page& page, unsigned int width, unsigned int height)
521 521 if ((textureWidth * 2 <= Texture::getMaximumSize()) && (textureHeight * 2 <= Texture::getMaximumSize()))
522 522 {
523 523 // Make the texture 2 times bigger
524   - sf::Image pixels = page.texture.copyToImage();
525   - page.texture.create(textureWidth * 2, textureHeight * 2);
526   - page.texture.update(pixels);
  524 + Image newImage;
  525 + newImage.create(textureWidth * 2, textureHeight * 2, Color(255, 255, 255, 0));
  526 + newImage.copy(page.texture.copyToImage(), 0, 0);
  527 + page.texture.loadFromImage(newImage);
527 528 }
528 529 else
529 530 {

1 comment on commit 49f37ee

TÖRÖK Attila

Yay! \o/

Please sign in to comment.
Something went wrong with that request. Please try again.