uDocShapeKindOf function

UDocShapeKind? uDocShapeKindOf(
  1. UDocDrawTool tool
)

Shape kind from its saved name.

Implementation

UDocShapeKind? uDocShapeKindOf(UDocDrawTool tool) {
  switch (tool) {
    case UDocDrawTool.pen:
      return UDocShapeKind.pen;
    case UDocDrawTool.highlighter:
      return UDocShapeKind.highlighter;
    case UDocDrawTool.line:
      return UDocShapeKind.line;
    case UDocDrawTool.arrow:
      return UDocShapeKind.arrow;
    case UDocDrawTool.doubleArrow:
      return UDocShapeKind.doubleArrow;
    case UDocDrawTool.rectangle:
      return UDocShapeKind.rectangle;
    case UDocDrawTool.roundedRectangle:
      return UDocShapeKind.roundedRectangle;
    case UDocDrawTool.ellipse:
      return UDocShapeKind.ellipse;
    case UDocDrawTool.areaHighlight:
      return UDocShapeKind.areaHighlight;
    case UDocDrawTool.textBox:
      return UDocShapeKind.textBox;
    case UDocDrawTool.stickyNote:
      return UDocShapeKind.stickyNote;
    case UDocDrawTool.none:
    case UDocDrawTool.select:
    case UDocDrawTool.eraser:
      return null;
  }
}