lib/third_party/tracing/model/location.js
function(viewport) {
      var dt = viewport.currentDisplayTransform;
      var containerToTrack = viewport.containerToTrackMap;
      var viewX = dt.xWorldToView(this.xWorld_);

      var viewY = -1;
      for (var index in this.yComponents_) {
        var yComponent = this.yComponents_[index];
        var track = containerToTrack.getTrackByStableId(yComponent.stableId);
        if (track !== undefined) {
          var boundRect = track.getBoundingClientRect();
          viewY = yComponent.yPercentOffset * boundRect.height + boundRect.top;
          break;
        }
      }

      return {
        viewX: viewX,
        viewY: viewY
      };
    }
function(viewport) {
      var dt = viewport.currentDisplayTransform;
      var containerToTrack = viewport.containerToTrackMap;
      var viewX = dt.xWorldToView(this.xWorld_);

      var viewY = -1;
      for (var index in this.yComponents_) {
        var yComponent = this.yComponents_[index];
        var track = containerToTrack.getTrackByStableId(yComponent.stableId);
        if (track !== undefined) {
          var boundRect = track.getBoundingClientRect();
          viewY = yComponent.yPercentOffset * boundRect.height + boundRect.top;
          break;
        }
      }

      return {
        viewX: viewX,
        viewY: viewY
      };
    }
function ( viewport ) { var dt = viewport . currentDisplayTransform ; var containerToTrack = viewport . containerToTrackMap ; var viewX = dt . xWorldToView ( this . xWorld_ ) ; var viewY = - 1 ; for ( var index in this . yComponents_ ) { var yComponent = this . yComponents_ [ index ] ; var track = containerToTrack . getTrackByStableId ( yComponent . stableId ) ; if ( track !== undefined ) { var boundRect = track . getBoundingClientRect ( ) ; viewY = yComponent . yPercentOffset * boundRect . height + boundRect . top ; break ; } } return { viewX : viewX , viewY : viewY } ; }
Calculates and returns x and y coordinates of the current location with
respect to the timeline's canvas.
Calculates and returns x and y coordinates of the current location with respect to the timeline s canvas .