OcdFileExport: Zero angle on non-rotatable objects#2530
Open
lpechacek wants to merge 1 commit into
Open
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&).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.