Page MenuHome

Cursor position wrong when edit text on curve
Closed, ResolvedPublic

Description

System Information
Operating system: OSX/Linux
Graphics card: Intel/Nvidia/AMD

Blender Version
Broken: Daily builds 2.80
Worked: never?

Short description of error
When having a text on a curve and entering edit mode, the cursor location is not at the end but one character before the last.. adding text however will still append to the end.

Exact steps for others to reproduce the error
Factory Defaults
Add Curve
Add Text
Select Text on Curve and select Curve
TAB to edit mode
Observe wrong cursor location

Event Timeline

Philipp Oeser (lichtwerk) lowered the priority of this task from 90 to 50.

Confirmed, same is true for 2.79. Will check in a bit if this is a hassle to get right...

Since 2.8 is master.. remove this tag.. maybe it will get some attention now ;-)

@Roel Koster (kostex): will look into this shortly [this wasnt high on the list because it is also an issue in 2.79...]

Philipp Oeser (lichtwerk) renamed this task from Cursor position wrong when edit text on curve (2.80) to Cursor position wrong when edit text on curve.Jan 23 2019, 3:40 PM
Philipp Oeser (lichtwerk) updated the task description. (Show Details)

This is caused by rB8a379e3460048

Commit message reads:

3D Text: avoid checking null character's text on path
Redundant and causes complications when improving text code.

And code comment:

null character is always zero width, no need to iterate over it

And while it is true that the width is always zero, the CharTrans->xof offset is still different from the previous characters... [which will result in the cursor being "off by one"]

So just reverting rB8a379e3460048 solves the issue [and afaict doesnt cause other issues], but I would kindly ask @Campbell Barton (campbellbarton) to doublecheck [not sure what he meant by "complications when improving text code"...]

Philipp Oeser (lichtwerk) changed the task status from Unknown Status to Resolved.Jan 29 2019, 12:53 PM

Should be resolved then, I guess rB964a3f109752e08cf384486c1c70c2d15193e898