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.


element kendo.drawing.Element

The drawing element that should be fitted.

rect kendo.geometry.Rect

The rectangle in which the elements should be fitted.


<div id="surface"></div>
  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));, rect);

  var surface = draw.Surface.create($("#surface"));
In this article
Not finding the help you need? Improve this article