[Fixed Position] Add ability to work in pixel space
Fix code style issues per Victor's review Add toggle to work in pixel space or grid space, per the issue description. Each element stores a boolean property that determines whether or not it snaps to grid space or pixel space. Coordinates are converted between spaces on toggle, preserving the size of the element in pixels. To complete: change UI element for toggle to a checkbox.
This commit is contained in:
@@ -19,12 +19,12 @@
|
||||
this source code distribution or the Licensing information page available
|
||||
at runtime from the About dialog for additional information.
|
||||
-->
|
||||
<svg ng-attr-width="{{parameters.gridSize[0] * ngModel.width()}}"
|
||||
ng-attr-height="{{parameters.gridSize[1] * ngModel.height()}}">
|
||||
<line ng-attr-x1="{{parameters.gridSize[0] * ngModel.x1() + 1}}"
|
||||
ng-attr-y1="{{parameters.gridSize[1] * ngModel.y1() + 1}}"
|
||||
ng-attr-x2="{{parameters.gridSize[0] * ngModel.x2() + 1}}"
|
||||
ng-attr-y2="{{parameters.gridSize[1] * ngModel.y2() + 1}}"
|
||||
<svg ng-attr-width="{{ngModel.getGridSize()[0] * ngModel.width()}}"
|
||||
ng-attr-height="{{ngModel.getGridSize()[1] * ngModel.height()}}">
|
||||
<line ng-attr-x1="{{ngModel.getGridSize()[0] * ngModel.x1() + 1}}"
|
||||
ng-attr-y1="{{ngModel.getGridSize()[1] * ngModel.y1() + 1}}"
|
||||
ng-attr-x2="{{ngModel.getGridSize()[0] * ngModel.x2() + 1}}"
|
||||
ng-attr-y2="{{ngModel.getGridSize()[1] * ngModel.y2() + 1}}"
|
||||
ng-attr-stroke="{{ngModel.stroke()}}"
|
||||
stroke-width="2">
|
||||
</line>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Reference in New Issue
Block a user