6. Circle Drawer

Go to Task 7

Sixth task of The 7 Tasks from 7GUIs

Challenges: undo/redo, custom drawing, dialog control.

The task is to build a frame containing an undo and redo button as well as a canvas area underneath. Clicking inside an empty area inside the canvas will create an circle with a fixed diameter whose center is the clicked point. The circle nearest to the mouse pointer such that the distance from its center to the pointer is less than its radius, if it exists, is the selected circle C. Clicking C will make a popup menu appear with a slider inside that adjusts the diameter of C. Changes are applied immediately.

Closing this frame will mark the last diameter as significant for the undo/redo history. Clicking undo will undo the last significant change (i.e. circle creation or diameter adjustment). Clicking redo will reapply the last undoed change unless new changes were made by the user in the meantime.

Deploys by Netlify