aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/private/switch-add
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2016-03-13 15:54:14 +0000
committerKristian Lyngstol <kly@kly.no>2016-03-13 15:54:14 +0000
commite7eb548d99a324048d6fd08cb5a0243e47753451 (patch)
tree5d56669259b598f37541ba35104f6d344e18eb28 /web/nms.gathering.org/api/private/switch-add
parentbecdfbb6f176542252397649507d646ee24da610 (diff)
NMSjs: Enable interactive movement of switches!
Fixes #24 God that felt good. It's not very pretty, but it does seem very functional.
Diffstat (limited to 'web/nms.gathering.org/api/private/switch-add')
-rwxr-xr-xweb/nms.gathering.org/api/private/switch-add9
1 files changed, 5 insertions, 4 deletions
diff --git a/web/nms.gathering.org/api/private/switch-add b/web/nms.gathering.org/api/private/switch-add
index 64e5e58..e177b5e 100755
--- a/web/nms.gathering.org/api/private/switch-add
+++ b/web/nms.gathering.org/api/private/switch-add
@@ -30,10 +30,10 @@ sub convertplace
my %out = ();
if (not defined $in{'x1'} and defined($in{'x'})) {
- $out{'x1'} = $in{'x'};
- $out{'y1'} = $in{'y'};
- $out{'xx'} = $in{'x'} + $in{'width'};
- $out{'yy'} = $in{'y'} + $in{'height'};
+ $out{'x1'} = int($in{'x'});
+ $out{'y1'} = int($in{'y'});
+ $out{'xx'} = int($in{'x'} + $in{'width'});
+ $out{'yy'} = int($in{'y'} + $in{'height'});
} else {
return \%in;
}
@@ -89,6 +89,7 @@ foreach my $tmp2 (@tmp) {
$x2 = $placement{'xx'};
$y2 = $placement{'yy'};
$switch{'placement'} = "(($x1,$y1),($x2,$y2))";
+ push @dups, "not really, but: " . $switch{'placement'};
}
if (not defined($switch{'ip'}) and defined($switch{'mgtmt4'})) {
$switch{'ip'} = $switch{'mgtmt4'};