akiraux / Akira

Native Linux App for UI and UX Design built in Vala and GTK
GNU General Public License v3.0
5.24k stars 202 forks source link

Fixes deserializing rectangle on file load #748

Open mradcliffe opened 4 months ago

mradcliffe commented 4 months ago
## Summary / How this PR fixes the problem? - Resolves loading a saved akira file with "rectangle" type. I found akira and started playing around with it, then ran into this bug. I figured out the file format was a zipped json file pretty quickly, opened it up, saw the inconsistency, and the found the issue. I don't really feel comfortable writing in vala, but I felt I would be comfortable enough to create a pull request for this small fix. ## Steps to Test 1. Open Akira 2. Press the Insert button 3. Choose Shapes 4. Choose Rectangle 5. Place the Rectangle 6. Save the file 7. Close Akira 8. Open Akira 9. Open the file Result: the application does not bail with Akira:ERROR:../src/FileFormat/JsonDeserializer.vala:113:akira_file_format_json_deserializer_deserialize_node: assertion failed: (false) ## Known Issues / Things To Do - The rest of #732 is out-of-scope of what I can contribute.
albfan commented 4 months ago

To really avoid the problem, can you do another commit to change all those Magic words into constants?

mradcliffe commented 4 months ago

can you do another commit to change all those Magic words into constants?

I reviewed to see if I could handle this. Is like the best place for this

Regardless it seems like model name_id method should return that constant as well.