Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html

Issue 2859143004: Correctly clamp in distance formulas (Closed)
Patch Set: Clamp distance correctly Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
index 78bc17efb3adb2c1d5a5ad92466cf9508f41974c..1fadc29d5f3f15c59f2a45620923b0cfd1cc05a8 100644
--- a/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
+++ b/third_party/WebKit/LayoutTests/webaudio/Panner/panner-distance-clamping.html
@@ -195,10 +195,14 @@
merger.connect(context.destination);
// Move the panner some distance away. Arbitrarily select the x
- // direction. For the reference panner, manually clamp the distance to
- // lie between refDistance and maxDistance.
- var xRef = Math.min(Math.max(options.distance, pannerRef.refDistance),
- pannerRef.maxDistance);
+ // direction. For the reference panner, manually clamp the distance.
+ // All models clamp the distance to a minimum of refDistance. Only the
+ // linear model also clamps to a maximum of maxDistance.
+ var xRef = Math.max(options.distance, pannerRef.refDistance);;
hongchan 2017/05/05 18:07:58 I see "double semicolon" here and the line 192.
Raymond Toy 2017/05/05 18:18:28 Done.
+
+ if (pannerRef.distanceModel === "linear") {
+ xRef = Math.min(xRef, pannerRef.maxDistance);
+ }
var xTest = options.distance;

Powered by Google App Engine
This is Rietveld 408576698