Пример #1
0
        public void DrawShapeGenerateJsonFromItAndConvertItBackToShape()
        {
            ITool CurrentTool = new RectangleTool();

            CurrentTool.GetShape(new CanvasEventArgs(new Point(100, 200), MouseState.DOWN), style);
            CurrentTool.GetShape(new CanvasEventArgs(new Point(80, 170), MouseState.MOVE), style);
            CurrentTool.GetShape(new CanvasEventArgs(new Point(60, 100), MouseState.MOVE), style);

            TikzShape[] shapes = new TikzShape[] {
                CurrentTool.GetShape(new CanvasEventArgs(new Point(40, 40), MouseState.UP), style).TikzShape
            };

            JsonFormatGenerator jsonGen = new JsonFormatGenerator();
            String jsonTikz             = jsonGen.ConvertMany(shapes);

            Assert.IsTrue(new JsonFormatLoader().ConvertMany(jsonTikz).ToList().Single(shape => shape is TikzRectangle) != null);
        }
Пример #2
0
 public DrawingShape(TikzShape shape, ShapeState shapeState)
 {
     TikzShape  = shape;
     ShapeState = shapeState;
 }