scale static method

Geometry scale(
  1. {required Geometry geometry,
  2. required double scaleX,
  3. required double scaleY,
  4. ArcGISPoint? origin}
)

Scales the given geometry by the specified factors from the specified origin point.

If the origin ArcGISPoint has a different SpatialReference than that of the geometry parameter, the point will be reprojected before the geometry is scaled, using the default transformation.

Scaling an ArcGISPoint using the same location for the origin parameter returns an ArcGISPoint with the same values as the input.

Positive scale factors greater than 1 increase the size of the GeometryEditor.geometry, and positive factors between 0 and 1 reduce the size of the geometry. 0 or negative scale factors produce a geometry reflected across the axes of the origin point. Negative factors less than -1 both reflect and increase the size of the geometry, and negative factors between -1 and 0 both reflect and reduce the size of the geometry. Scale factors of -1 reflect the geometry across the axes of the origin point without changing the size.

Supports true curves.

Parameters:

  • geometry — The geometry to scale.
  • scaleX — The scale factor along the x-axis. It can be positive or negative. It cannot be a non-numeric value.
  • scaleY — The scale factor along the y-axis. It can be positive or negative. It cannot be a non-numeric value.
  • origin — The point around which the geometry will be scaled. If null, or Geometry.isEmpty is true, the center of the extent of the geometry parameter is used.

Return Value: A new geometry constructed by scaling the input geometry by the specified factors from the specified origin point.

Implementation

static Geometry scale(
    {required Geometry geometry,
    required double scaleX,
    required double scaleY,
    ArcGISPoint? origin}) {
  _initializeArcGISEnvironmentIfNeeded();
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_scale(geometry._handle, scaleX,
        scaleY, origin?._handle ?? ffi.nullptr, errorHandler);
  });
  return Geometry._fromHandle(objectHandle)!;
}