New to Kendo UI for jQueryStart a free 30-day trial

Fit

methods

Scales uniformly an element so that it fits in a given rectangle. No scaling will be applied if the element is already small enough to fit in the rectangle.

Parameters:elementkendo.drawing.Element

The drawing element that should be fitted.

rectkendo.geometry.Rect

The rectangle in which the elements should be fitted.

<div id="surface"></div>
<script>
  var draw = kendo.drawing;
  var Rect = kendo.geometry.Rect;

  var group = new draw.Group();
  var rect = new Rect([0, 0], [200, 100]);
  var path = draw.Path.fromRect(new Rect([0, 0], [300, 300]), {
    fill: {
      color: "#ff0000"
    }
  });
  group.append(path, draw.Path.fromRect(rect));

  draw.fit(path, rect);

  var surface = draw.Surface.create($("#surface"));
  surface.draw(group);
</script>
Not finding the help you need?
Contact Support