Skip to content

SketchMorph2 Core

Kuganash Ravishanker edited this page Aug 3, 2022 · 28 revisions

MorphicMonet

This name was chosen as a collective term for all frontend functionality. This handles the user interface and displays the M2Canvas

The MorphicMonet class contains code for setting up the UI and functions requiring file system interaction.

Currently, the UI consists of a menu bar and the M2Canvas.

M2Backend

This class implements the functionality for drawing on an M2Canvas.
It also uses the M2UndoLevel and M2UserAction classes to implement Undo functionality.

The form class

A lot of the backend functionality is already included in the form class. It provides a way to draw with a pen by describing its movements.
It is relatively easy to understand and use, but please note that unlike everything else in squeak, form has a zero-based index.

M2ViewPort

This holds the form shown to the user in the canvas, which is the backend form, scaled according to the current zoom factor.

M2Canvas

This is an ImageMorph that displays the viewPort's form to the user and handles mouse input that it relays to the backend.

M2Layer

This class implements the new layer system. This allows the user to draw, edit and rename different layers and also the user can hide/show and toggle between layers.

M2TemporaryGeometricMorph

This class creates a temporary morph which is created by the user when they draw a geometric shape in the canvas. This allows the user to move or rotate the created shapes and then the user can project the shape on the canvas by clicking on the canvas or by selecting another tool.

Clone this wiki locally