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

Author Topic: Small Bug with new Text(Text copy)  (Read 4272 times)

0 Members and 1 Guest are viewing this topic.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Small Bug with new Text(Text copy)
« on: February 27, 2012, 10:31:05 pm »
When creating a new Text object the new object does not have the position of the object that it was copied from. Here is a small and complete example that reproduces the problem.
Code: [Select]
using SFML.Graphics;
using SFML.Window;
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        RenderWindow _window;
        Text _text1;
        Text _text1COPY;
        private void Form1_Load(object sender, EventArgs e)
        {
            _window = new RenderWindow(this.Handle);
            _text1 = new Text("Testing Text Copy", SFML.Graphics.Font.DefaultFont, 24);
            _text1.Position = new Vector2f(100,100);
            _text1COPY = new Text(_text1);
        }
        protected override void OnPaint(PaintEventArgs e)
        {
            _window.Clear(Color.Black);
            _window.Draw(_text1);
            _window.Draw(_text1COPY);
            _window.Display();
        }
    }
}


Basically when ran all you should see is one line of text being rendered. Instead you see 2 lines. The one line is at the set coordinates(100, 100) while the second line is at 0,0 because the original coordinates did not copy over.

Edit: Here is a screenshot of what the code renders.
http://imageshack.us/photo/my-images/189/textbug.jpg/
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Small Bug with new Text(Text copy)
« Reply #1 on: February 29, 2012, 02:20:53 am »
Nothing to say Laurent?  :?:
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Small Bug with new Text(Text copy)
« Reply #2 on: February 29, 2012, 08:04:23 am »
Sorry: "I'll fix it as soon as possible" :)
Laurent Gomila - SFML developer

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Small Bug with new Text(Text copy)
« Reply #3 on: February 29, 2012, 03:55:06 pm »
Quote from: "Laurent"
Sorry: "I'll fix it as soon as possible" :)

No problem, just wondered why you hadn't confirmed it.  8)
Thanks again for your great work with SFML  :lol:
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Small Bug with new Text(Text copy)
« Reply #4 on: March 04, 2012, 02:59:06 pm »
It's fixed.
Laurent Gomila - SFML developer

 

anything