OpenOrienteering / mapper

OpenOrienteering Mapper is a software for creating maps for the orienteering sport.
https://www.openorienteering.org/apps/mapper/
GNU General Public License v3.0
400 stars 106 forks source link

Losing "Hatch/Structure oriented to north when rotating the map" symbol property in Ocad files. #1677

Open andzs opened 4 years ago

andzs commented 4 years ago

Steps to reproduce

  1. Open attached Ocad12 Sample.ocd file in OOM. Sample.zip

  2. Rotate map (Map->Rotate) in OOM for 15 degrees for example. In OOM everything works fine. Appearance of symbols on map is correct after rotation.

  3. Save this map back in Ocad 12 format as Sample_rotated.ocd

  4. Open map Sample_rotated.ocd in Ocad12 and rotate it back (Map->Transform->Rotate Map) by -15 degreees and uncheck "Rotate objects with symbols oriented to North".

Actual behaviour

Resulting map is oriented back, but symbol appearance is wrong. Pattern of marshes and vegetation symbols is rotated because symbol definitions are lacking "Hatch/Structure oriented to north when rotating the map" property.

Expected behaviour

Editing Ocad files in OOM and saving back in ocd format should retain "Hatch/Structure oriented to north when rotating the map" property of symbols.

Configuration

Mapper Version: 0.9.3 Operating System: OS Name: Microsoft Windows 10 Pro OS Version: 10.0.18362 N/A Build 18362

lpechacek commented 4 years ago

Confirmed. Mapper makes objects rotatable. This is a bug in the importer routines. Thanks for the report!

lpechacek commented 4 years ago

I've got a fix and now I'm investigating why the defect was not caught by automated testing.

For the record, simplified test routine:

  1. Open the attached Ocad12 Sample.ocd file in OOM.
  2. Select one of the objects and try to rotate its pattern with Rotate pattern tool

Actual behavior: The pattern happily rotates.

Expected behavior: The Rotate pattern tool is disabled and no pattern rotation is possible.

lpechacek commented 3 years ago

I'm reopening the issue as my original fix was wrong. The explanation is in https://github.com/OpenOrienteering/mapper/issues/1926#issuecomment-811033479.

lpechacek commented 3 years ago

My thoughts on this issue as of today.

I always read ISOM with the first interpretation in mind. The second one feels awkward to me. That said, I propose that we set the "pattern oriented to the north" flag when the imported symbol has a north orientation and all the objects using this symbol have zero rotation. If there is an object with non-zero rotation using a north-oriented symbol, we will reset the symbol pattern flags and issue an import warning.