KineticJS
KineticJS copied to clipboard
Text align to right have strange issue
Hi!
I'm glad to use Kinetic ;) it's work perfectly. And i don't have any issue since now. I just wondering why text with align right always have little bug. The last line of multi lane text always is little moved to right. It's look something like that:
"text text text blah blah bl text blah text"
When we expected:
"text text text blach blah bl text blah text"
Here is sample code:
var circle = new Kinetic.Circle({
x: 0,
y: 0,
radius: radius,
fill: col
});
var text = new Kinetic.Text({
x: 0,
y: 0,
text: tex,
fontSize: fontSize,
fontFamily: 'Oxygen',
fill: 'white',
width: radius*2-3,
padding: 5,
wrap: 'word',
align: 'right'
});
var group = new Kinetic.Group({
x: xx,
y: yy,
scale: 0,
id: idd
});
group.add(circle);
group.add(text);
finally i know why this bug is happen. It's cause that wraping didn't erase white space. And if i ann simply space to end my string text will display normally. I think this is easy to rapair ;)
Glad you could figure it out!