mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 20:11:24 +01:00
Fixes for review comments
Reverted icons.css to master Removed index.html/icon-route class and modified size for SVG icon on button Refactored RouteOpisometer.trackCell so that duplicate code is pulled outside of if blocks
This commit is contained in:
parent
426ee32ee5
commit
f0f7ebb71f
3 changed files with 7 additions and 14 deletions
|
|
@ -204,7 +204,6 @@
|
|||
.icon-chess-pawn:before {content:'\f443';} /* '' */
|
||||
.icon-chess-queen:before {content:'\f445';} /* '' */
|
||||
.icon-chess-rook:before {content:'\f447';} /* '' */
|
||||
/*.icon-route:before {content:'\f4d7';} /* '' */
|
||||
.icon-sign:before {content:'\f4d9';} /* '' */
|
||||
.icon-user-friends:before {content:'\f500';} /* '' */
|
||||
.icon-user-shield:before {content:'\f505';} /* '' */
|
||||
|
|
|
|||
|
|
@ -3099,8 +3099,8 @@
|
|||
<div id="unitsBottom">
|
||||
<button id="addLinearRuler" data-tip="Click to place a linear measurer (ruler)" class="icon-ruler"></button>
|
||||
<button id="addOpisometer" data-tip="Drag to measure a curve length (opisometer)" class="icon-drafting-compass"></button>
|
||||
<button id="addRouteOpisometer" data-tip="Drag to measure a curve length that sticks to routes (route opisometer)" class="icon-route">
|
||||
<svg width="1em" height="1em">
|
||||
<button id="addRouteOpisometer" data-tip="Drag to measure a curve length that sticks to routes (route opisometer)">
|
||||
<svg width="0.88em" height="0.88em">
|
||||
<use xlink:href="#icon-route" />
|
||||
</svg>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -333,13 +333,9 @@ class RouteOpisometer extends Measurer {
|
|||
} else if (cellStops.length > 1 && foundIndex != -1) {
|
||||
cellStops.splice(foundIndex + 1);
|
||||
this.points.splice(foundIndex + 1);
|
||||
this.updateCurve();
|
||||
this.updateLabel();
|
||||
} else {
|
||||
cellStops.push(cell);
|
||||
this.points.push(this.getCellRouteCoord(cell));
|
||||
this.updateCurve();
|
||||
this.updateLabel();
|
||||
}
|
||||
} else {
|
||||
if (cellStops[0] === cell) {
|
||||
|
|
@ -347,16 +343,14 @@ class RouteOpisometer extends Measurer {
|
|||
} else if (cellStops.length > 1 && foundIndex != -1) {
|
||||
cellStops.splice(0, foundIndex);
|
||||
this.points.splice(0, foundIndex);
|
||||
this.updateCurve();
|
||||
this.updateLabel();
|
||||
} else {
|
||||
cellStops.unshift(cell);
|
||||
this.points.unshift(this.getCellRouteCoord(cell));
|
||||
}
|
||||
}
|
||||
this.updateCurve();
|
||||
this.updateLabel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getCellRouteCoord(c) {
|
||||
const cells = pack.cells;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue