Describe the bug
The Seam Allowance reappears
How To Reproduce the bug
When the drawing is finished and the pattern is created you go to the 'PatternPart' layout. You will see the pattern created with the seam allowance turned ON. Go to the properties > Seam Allowance and untick the 'Show cutting line'. Click OK and the allowance is invisible now. When you then save the changes made by clicking CTRL-S using the keyboard the seam allowance reappears and the tick next 'Show cutting line' is switched ON again. It does not do so when clicking the SAVE button in the ribbon.
What should have happened
Seam allowance should not be turned on again
Screenshots
What's your Desktop OS? _Windows 10
What's your Seamly version from Help/About? _Seamly 2024.1.1.152
Hello, @DraftCraft
Can you post your pattern and measurement file so that @Douglas can check it out, please?
There’s a;ready a Github issue.
It is consistent with all patterns at the moment. I have created a very very simple example file. No measurement file involved. It has three lines in a triangle. It behaves as I explained earlier. Seam allowance when created. Save the file. Goto properties. Switch of the cutting line and accept the changes. line is now gone. Save the file using CTRL-S and the seam allowance re-appears.
BTW the github ussue was also created by me.
ps I do not know how to attach and upload a file. It should be easy but can’t find it. However, my example file doesn’t contain more then three random lines. This should be easily replicated.
Not sure if you meant on Githib or here… on Githib I just drag and drop images into the issue box. Here you can click:
I started to reply to the Github issue why there was a Save issue for you - which is not a bug per se, but then I discovered there is an issue with the toggle button getting out of sync so I scrapped my reply. The reason why it saves when you use the menu and not when using the short cut is because when the pattern piece is still selected it has keyboard focus and the Context menu is in effect - where the Ctrl key is discarded and the “S” toggles the seam allowance. If you click OFF the piece, then the main file menu is able to act on Ctrl + S and save the pattern. That’s why you think you were saving, when in fact you were turning the SA back on.
Thanks for your explanation. An unfortunate coincidence that Save and Seam Allowance both start with an S as hotkey.
No. One starts with Ctrl modifier. It has more to do with how each is being handled within the (widget) class (there’s more than one way to handle key events, one easier than the other), and which (widget) class has focus, and whether the event is passed on to other widgets. I’m with some refactoring both events could be handled within the active piece.
Fixed it so it will now Save() the pattern when “Ctrl + S” is pressed, even when a piece is selected. If the piece is selected AND the “S” is pressed, it will toggle the seam allowance.
Just had to test if the Ctrl modifier for the event was pressed, if it was, fall out of the event handler and let the mainwindow handle key events as normal otherwise handle the S key event.
case Qt::Key_S:
{
if (event->modifiers() & Qt::ControlModifier)
{
break;
}
toggleSeamAllowance(!piece.IsSeamAllowance());
break;
}