code: function(badComponent, goodComponent) {
          if (goodComponent.equals(badComponent)) {
              return "";
          }
          var resolution = this.getResolution();
          var maxX = this.MAX_PIXEL - this.translationParameters.x;
          var maxY = this.MAX_PIXEL - this.translationParameters.y;
          var x1 = (goodComponent.x - this.featureDx) / resolution + this.left;
          var y1 = this.top - goodComponent.y / resolution;
          var x2 = (badComponent.x - this.featureDx) / resolution + this.left;
          var y2 = this.top - badComponent.y / resolution;
          var k;
          if (x2 < -maxX || x2 > maxX) {
              k = (y2 - y1) / (x2 - x1);
              x2 = x2 < 0 ? -maxX : maxX;
              y2 = y1 + (x2 - x1) * k;
          }
          if (y2 < -maxY || y2 > maxY) {
              k = (x2 - x1) / (y2 - y1);
              y2 = y2 < 0 ? -maxY : maxY;
              x2 = x1 + (y2 - y1) * k;
          }
          return x2 + "," + y2;
      }
docs: Method: clipLine
  Given two points (one inside the valid range, and one outside),
  clips the line betweeen the two points so that the new points are both
  inside the valid range.
  
  Parameters:
  badComponent - {<OpenLayers.Geometry.Point>} original geometry of the
  invalid point
  goodComponent - {<OpenLayers.Geometry.Point>} original geometry of the
  valid point
  Returns
  {String} the SVG coordinate pair of the clipped point (like
  getShortString), or an empty string if both passed componets are at
  the same point.