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

Unified Diff: tracing/tracing/ui/base/camera.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: Fix test Created 3 years, 9 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: tracing/tracing/ui/base/camera.html
diff --git a/tracing/tracing/ui/base/camera.html b/tracing/tracing/ui/base/camera.html
index 70ed50d499e9f0cf68db37f1e01e446950f4913c..2d2ae14d1821c36e7ee6723da8ac6865f3a17b52 100644
--- a/tracing/tracing/ui/base/camera.html
+++ b/tracing/tracing/ui/base/camera.html
@@ -193,8 +193,9 @@ tr.exportTo('tr.ui.b', function() {
constants.MINIMUM_DISTANCE,
constants.MAXIMUM_DISTANCE);
- for (var i = 0; i < 3; ++i)
+ for (var i = 0; i < 3; ++i) {
this.gazeTarget_[i] = this.eye_[i] + newLength * gazeVector[i];
+ }
}
this.saveCameraToSettings(tr.b.SessionSettings());
@@ -212,10 +213,11 @@ tr.exportTo('tr.ui.b', function() {
var length = vec3.length(eyeVector);
// Clamp the length to allowed values by changing the scale.
- if (length * scale < constants.MINIMUM_DISTANCE)
+ if (length * scale < constants.MINIMUM_DISTANCE) {
scale = constants.MINIMUM_DISTANCE / length;
- else if (length * scale > constants.MAXIMUM_DISTANCE)
+ } else if (length * scale > constants.MAXIMUM_DISTANCE) {
scale = constants.MAXIMUM_DISTANCE / length;
+ }
vec3.scale(eyeVector, eyeVector, scale);
vec3.add(this.eye_, this.gazeTarget_, eyeVector);
@@ -228,10 +230,12 @@ tr.exportTo('tr.ui.b', function() {
delta[0] *= 0.5;
delta[1] *= 0.5;
- if (Math.abs(this.rotation_[0] + delta[1]) > constants.MAXIMUM_TILT)
+ if (Math.abs(this.rotation_[0] + delta[1]) > constants.MAXIMUM_TILT) {
return;
- if (Math.abs(this.rotation_[1] - delta[0]) > constants.MAXIMUM_TILT)
+ }
+ if (Math.abs(this.rotation_[1] - delta[0]) > constants.MAXIMUM_TILT) {
return;
+ }
var eyeVector = [0, 0, 0, 0];
vec3.subtract(eyeVector, this.eye_, this.gazeTarget_);
@@ -270,8 +274,7 @@ tr.exportTo('tr.ui.b', function() {
},
onPanUpdate_: function(e) {
- if (!this.panning_)
- return;
+ if (!this.panning_) return;
var delta = this.getMouseDelta_(e, this.lastMousePosition_);
this.lastMousePosition_ = this.getMousePosition_(e);
@@ -292,8 +295,7 @@ tr.exportTo('tr.ui.b', function() {
},
onZoomUpdate_: function(e) {
- if (!this.zooming_)
- return;
+ if (!this.zooming_) return;
var delta = this.getMouseDelta_(e, this.lastMousePosition_);
this.lastMousePosition_ = this.getMousePosition_(e);
@@ -311,8 +313,7 @@ tr.exportTo('tr.ui.b', function() {
},
onRotateUpdate_: function(e) {
- if (!this.rotating_)
- return;
+ if (!this.rotating_) return;
var delta = this.getMouseDelta_(e, this.lastMousePosition_);
this.lastMousePosition_ = this.getMousePosition_(e);

Powered by Google App Engine
This is Rietveld 408576698