summaryrefslogtreecommitdiff
path: root/src/client/view/graph_view.js
diff options
context:
space:
mode:
authorAlon Levy <alon@pobox.com>2015-03-01 11:36:18 +0200
committerAlon Levy <alon@pobox.com>2015-03-01 11:36:18 +0200
commit4cdf0483794a2dcdfc3e23098ef8dcff71256631 (patch)
treeabe5943e55f1aede866ff8bc26179a3f5a0aabb2 /src/client/view/graph_view.js
parent3d9c978a1b32b519ce5d371833af21ba35cf145e (diff)
view/graph_view: yet another fix for scaling
Diffstat (limited to 'src/client/view/graph_view.js')
-rw-r--r--src/client/view/graph_view.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/client/view/graph_view.js b/src/client/view/graph_view.js
index 7356a23d..52952645 100644
--- a/src/client/view/graph_view.js
+++ b/src/client/view/graph_view.js
@@ -570,10 +570,7 @@ function GraphView(spec) {
scaled_high = forward(rect_high),
new_scale;
- if (segment_in_segment(scaled_low, scaled_high, screen_low, screen_high)) {
- return [current_scale, function () { return current_translate; }];
- }
- new_scale = (rect_high == rect_low ?
+ new_scale = ((rect_high === rect_low || segment_in_segment(scaled_low, scaled_high, screen_low, screen_high)) ?
current_scale : (screen_high - screen_low) / (rect_high - rect_low) * percent);
new_scale = Math.min(3, Math.max(0.1, new_scale));
return [