Skip to content

Commit

Permalink
Fix th2 point altitude -value round-trip
Browse files Browse the repository at this point in the history
Fixes #23
  • Loading branch information
speleo3 committed Dec 7, 2024
1 parent fa9bfec commit 3449019
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 0 additions & 3 deletions extensions/th2_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,6 @@ def output_point(self, node):
self.guess_text_align(node, style, options)
self.guess_text_scale(node, style, options, mat)

if type == 'altitude' and options[key].isdigit():
options[key] = "[fix " + options[key] + "]"

if type in ('altitude', 'label') and text == '{ALTITUDE}':
type = 'altitude'
del options[key]
Expand Down
12 changes: 12 additions & 0 deletions tests/data/create.th2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ encoding utf-8

scrap create.s -scale [-128.0 -128.0 620.125 -128.0 0.0 0.0 19.002375 0.0 m]

point 440.0 340.0 altitude -value [fix 5 m]

point 400.0 340.0 altitude -value [fix 5]

point 440.0 320.0 altitude -value [5 m]

point 400.0 320.0 altitude -value 5

point 440.0 300.0 altitude -value -

point 400.0 300.0 altitude

point 201.0 156.0 label -align bl -scale s -text "Label S"

point 318.0 394.0 label -align tr -scale l -text "Label L"
Expand Down

0 comments on commit 3449019

Please sign in to comment.