SFML community forums

Bindings - other languages => DotNet => Topic started by: zsbzsb on February 27, 2012, 10:31:05 pm

Title: Small Bug with new Text(Text copy)
Post by: zsbzsb 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/
Title: Small Bug with new Text(Text copy)
Post by: zsbzsb on February 29, 2012, 02:20:53 am
Nothing to say Laurent?  :?:
Title: Small Bug with new Text(Text copy)
Post by: Laurent on February 29, 2012, 08:04:23 am
Sorry: "I'll fix it as soon as possible" :)
Title: Small Bug with new Text(Text copy)
Post by: zsbzsb 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:
Title: Small Bug with new Text(Text copy)
Post by: Laurent on March 04, 2012, 02:59:06 pm
It's fixed.