Refactoring for more consistency

* Min and max number of points configurable for lines and polygons
* Polygons from custom geometryFunction now have a sketch line
* The example shows how to use a custom geometryFunction
This commit is contained in:
Andreas Hocevar
2015-05-20 10:28:16 +02:00
parent 19c91235ce
commit 100020fd59
6 changed files with 151 additions and 106 deletions
+4 -1
View File
@@ -7,7 +7,9 @@ docs: >
dropdown above to start drawing. To finish drawing, click the last
point. To activate freehand drawing for lines and polygons, hold the `Shift`
key. Square drawing is achieved by using Circle mode with a `geometryFunction`
that creates a 4-sided regular polygon instead of a circle.
that creates a 4-sided regular polygon instead of a circle. Box drawing uses a
custom `geometryFunction` that takes start and end point of a line with 2
points and creates a rectangular box.
tags: "draw, edit, freehand, vector"
---
<div class="row-fluid">
@@ -22,6 +24,7 @@ tags: "draw, edit, freehand, vector"
<option value="Polygon">Polygon</option>
<option value="Circle">Circle</option>
<option value="Square">Square</option>
<option value="Box">Box</option>
</select>
</form>
</div>