Folks,

I just added this patch to the javascript zooming code ...

When you extend the selected area over the graph, you will get a reasonable 
zoomout behaviour.

cheers
tobi

PS the demo site is updated

--- cropper/smokeping-zoom.js   (revision 834)
+++ cropper/smokeping-zoom.js   (revision 837)
@@ -55,11 +55,20 @@
     var myURL = myURLObj.getUrlBase();

     // Generate Selected Range in Unix Timestamps
+    var LeftFactor = 1;
+    var RightFactor = 1;

-    var NewStartEpoch = Math.floor(StartEpoch + (SelectLeft  - RRDLeft) * 
DivEpoch / RRDImgUsable );
-    EndEpoch  =  Math.ceil(StartEpoch + (SelectRight - RRDLeft) * DivEpoch / 
RRDImgUsable );
-    StartEpoch = NewStartEpoch;
+    if (SelectLeft < RRDLeft)
+        LeftFactor = 10;

+    StartEpoch = Math.floor(StartEpoch + (SelectLeft  - RRDLeft) * DivEpoch / 
RRDImgUsable * LeftFactor );
+
+    if (SelectRight > RRDImgWidth - RRDRight)
+        RightFactor = 10;
+
+    EndEpoch  =  Math.ceil(EndEpoch + (SelectRight - (RRDImgWidth - RRDRight) 
) * DivEpoch / RRDImgUsable * RightFactor);
+
+
     $('zoom').src = myURL + '?displaymode=a;start=' + StartEpoch + ';end=' + 
EndEpoch + ';target=' + Target;

     myCropper.setParams();


-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch [EMAIL PROTECTED] ++41 62 213 9902

_______________________________________________
smokeping-users mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/smokeping-users

Reply via email to