daem-on / wtherion

A web-based Therion map editor
https://daem-on.github.io/wtherion/
MIT License
17 stars 2 forks source link

XVI images not placed in the correct position #5

Closed daem-on closed 2 years ago

daem-on commented 2 years ago

XTherion embeds XVI graphics into TH2 files using special comment formats. Example:

encoding  utf-8
##XTHERION## xth_me_area_adjust -128.0 -128.0 2726.4199999999996 1939.02
##XTHERION## xth_me_area_zoom_to 100
##XTHERION## xth_me_image_insert {1063.0 1 1.0} {1102.3600000000001 3a} elev1.xvi 0 {}

This apparently means that station 3a should be placed at (1060, 1102). Significant work needed to implement.

CaverBruce commented 2 years ago

Looking at some of my xvi files and how they are inserted by XTherion into th2, your deduction on xvi placement appears correct. Related information available in #1

daem-on commented 2 years ago

@CaverBruce can you please check if this works for you, afterwards we can close the issue. I haven't had a lot of time so I didn't work on this sooner, sorry.

CaverBruce commented 2 years ago

Looks like you've nailed it. I just loaded a moderately complex th2 (3000+ lines, 7 scraps and 4 xvi). It is super fast and the xvi colours are clearly rendered (unlike XTherion). I took it through an OtherExports.DownloadSave to json, then imported the resulting json (Import.JSON) and then exported to th2. The imported document looks good in WTherion, but git shows a reasonable difference in the th2 file. The th2 file will not open in XTherion, probably because the th2 ##XTHERION## headers are missing. I have a lot of annoying finicky comments to work through, I will post them as separate issues. I don't seem to be able to close this one, so I'll leave it to you. I don't consider your response slow, sometimes life holds treasures more than cave software. Take your time.

daem-on commented 2 years ago

Okay, since this part is working I'm closing the issue.