Changing colours does not work

Issue #24 resolved
Siddharth Shekar repo owner created an issue
  1. Draw an object (eg, rectangle).
  2. Without selecting the rectangle, change the pen colour to red.
  3. Select the rectangle and change the pen colour to red.

Expected behaviour: The rectangle's colour changes to red. Observed behaviour: The rectangle's colour remains black.

Comments (2)

  1. Siddharth Shekar reporter

    This is not limited to the pen colour alone. It is happening because in the method to change the pen colour, a check is in place to make sure that the new colour is not the same as the selectedPenColour in the view (the check is in place to ensure that repeatedly selecting the same colour does not keep adding it to the undo stack). Step 2 sets the selectedPenColour in the view to red. When an attempt is made to change the rectangle's colour to red, the change does not happen since red is already selectedPenColour. A fix for now is to first change the colour to something else (like green, for example) and then change to red.

  2. Log in to comment