OcdFileExport: Zero angle on non-rotatable objects - #2530
Conversation
Text and point objects with non-rotatable symbol appear orientated to north in Mapper. Output zero rotation angle in OCD format so that the objects maintain its orientation. The approach follows the logic in Object::save(QXmlStreamWriter&).
Partly, due to text appears rotated regardless of the lock setting (as you pointed out), text objects with non-rotatable symbol don't always appear orientated to north in Mapper (but I propose to change that).
The north rotation lock is not always removed from the point symbol, it depends on the rotation value: only if there is a rotation, it's being removed (and thus the objects appears the same as in OCAD), with the exception in #2498.
Yes, it does but the patch will also break OCD roundtrip: importing a rotated text object might result in loosing the rotation on export to OCD whereas for rotated point objects rotated point objects would always loose their rotation. Right now there is an inconsistency especially for text objects: I propose to change the behavior in text appears rotated regardless of the lock setting to
|
Text and point objects with non-rotatable symbol appear orientated to north in Mapper. When writing XML, Mapper skips the rotation attribute in
Object::save(QXmlStreamWriter&).However, if a map is opened from OCD format, the north rotation lock is silently removed from point symbols. The user may restore the rotation lock by either replacing the symbol set or a manual intervention. Then if the map is saved in OCD format, the symbol has north orientation (rotation lock) and the object has rotation angle set. If the map is reopened in Mapper, the cycle repeats - there is a rotated object with a point symbol, so Mapper removes the lock again.
The text symbols do not have the rotation lock removal logic in OCD import and text appears rotated regardless of the lock setting. As a result, north oriented text is rendered as rotated and cannot be straightened by the Rotate pattern tool. The Rotate object tool, which is enabled for the object in question, creates funny effects.
This patch aligns the export logic in OCD export path with the XML counterpart.