Lesson 14 - Canvas mode and auxiliary UI
infinitecanvas.cc·8h
Flag this post

Previously, we implemented some canvas UI components using Web Components, including camera zooming and image downloading. In this lesson, we will expose more canvas capabilities through components and implement some new drawing properties:

  • Implement zIndex and sizeAttenuation drawing properties
  • Move, rotate, and scale the canvas in hand mode
  • Select, drag, and move shapes in selection mode, and display the shape property panel

Before implementing canvas modes, we need to do some preparatory work to support the zIndex and sizeAttenuation drawing properties.

Implementing zIndex

The mask layer displayed after selecting a shape needs to be displayed above all shapes, which involves the use of display order, controlled by zIndex:

ts

mask.zIndex = 99...

Similar Posts

Loading similar posts...