summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCode WvS <code-wvs@quantentunnel.de>2015-03-01 17:53:23 +0100
committerCode WvS <code-wvs@quantentunnel.de>2015-03-01 17:53:23 +0100
commit0f4690453967dcc8a58b8c120007902353113c79 (patch)
treeef06af4288d03123dfdd3de988186ea294f30d29
parent2a6993efae6e961660ecd2aa1f999f10aadf94f4 (diff)
downloadsnap-yow-0f4690453967dcc8a58b8c120007902353113c79.tar.gz
snap-yow-0f4690453967dcc8a58b8c120007902353113c79.zip
comments and code style
-rw-r--r--objects.js13
-rwxr-xr-xsnap.html5
2 files changed, 13 insertions, 5 deletions
diff --git a/objects.js b/objects.js
index b8b0ccd..0e9acad 100644
--- a/objects.js
+++ b/objects.js
@@ -3317,18 +3317,21 @@ SpriteMorph.prototype.drawLine = function (start, dest) {
if (!window.polylines[this.myPolylineIndex]) {
// add a new line with start and end points
window.polylines[this.myPolylineIndex] = L.polyline([
- [stage.dimensions.y / 2 - from.y,
- from.x - stage.dimensions.x / 2], destLatLng,
- ],
+ [stage.dimensions.y / 2 - from.y,
+ from.x - stage.dimensions.x / 2],
+ destLatLng,
+ ],
{color: this.color.toString(), weight: this.size})
.addTo(window.penTrails);
} else {
var latlngs = window.polylines[this.myPolylineIndex].getLatLngs();
for (var j = 0; j < latlngs.length; j++) {
if (latlngs[j].distanceTo(destLatLng) < 0.1) {
- var polyLL = window.polylines[this.myPolylineIndex].spliceLatLngs(j, latlngs.length)
+ var polyLL = window.polylines[this.myPolylineIndex]
+ .spliceLatLngs(j, latlngs.length)
.concat([destLatLng]);
- L.polygon(polyLL, {color: this.color.toString(), weight: this.size})
+ L.polygon(polyLL,
+ {color: this.color.toString(), weight: this.size})
.addTo(window.penTrails);
break;
}
diff --git a/snap.html b/snap.html
index ab02c64..611581a 100755
--- a/snap.html
+++ b/snap.html
@@ -112,6 +112,11 @@
// OSMBuildings provides fancy 3D buildings
new OSMBuildings(map).load();
+ // A Sprite's X position is mapped to longitude
+ // A Sprite's Y position is mapped to latitude
+ // The stage has -x left and +x right,
+ // -y top and +y bottom but we want
+ // +y top and -y bottom.
window.spriteGroup = spriteGroup;
spriteGroup = L.layerGroup().addTo(map);