fullstack-lang/gongsvg

Implement behavioral logic

Closed this issue · 0 comments

Steps:

  • add a Impl field to Rect
  • add a package "bahavior"
  • add a RectOrchestratorImpl struct with method func AfterUpdateFromFront(stage *gongsvg_models.StageStruct, stagedRect, backRepoRect *gongsvg_models.Rect) that calls stagedRect.Impl.AfterUpdateFromFront(stage *gongsvg_models.StageStruct, stagedRect, backRepoRect *Rect)
  • add a RectImplstruct that implements AfterUpdateFromFront(stage *gongsvg_models.StageStruct, stagedRect, backRepoRect *gongsvg_models.Rect)
  • add a function Connect(stage *gongsvg_models.StageStruct) to plug the RectImpl to the Rect and that hooks Stage.AfterUpdateFromFront to RectOrchestratorImpl

In the behavior function

  • Add ShowHorizontalHandles and allow Handles to appears only if true
  • Add CanHaveHorizontalHandles and set ShowHorizontalHandles to true if Selected and CanHaveHorizontalHandles
  • Add CanBeMovedHorizontally
  • Add CanBeMovedVertically
  • Allow a control inversion via a RectUpdated(stagedRect, backRepoRect *gongsvg_models.Rect)