From e691a42b90669d62bd6fc6d001274bd646960877 Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Tue, 5 Apr 2022 14:52:51 +0200 Subject: [PATCH] add docs to scale, rotate --- src/components.jl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components.jl b/src/components.jl index c3095d51..15bb4dbe 100644 --- a/src/components.jl +++ b/src/components.jl @@ -159,10 +159,15 @@ function scale!(shape::Shape, x::Real, y::Real = x, c = center(shape)) shape end +""" + scale(shape, x, y = x, c = center(shape)) + scale!(shape, x, y = x, c = center(shape)) + +Scale shape by a factor. +""" scale(shape::Shape, x::Real, y::Real = x, c = center(shape)) = scale!(deepcopy(shape), x, y, c) -"translate a Shape in space" function translate!(shape::Shape, x::Real, y::Real = x) sx, sy = coords(shape) for i in eachindex(sx) @@ -172,6 +177,12 @@ function translate!(shape::Shape, x::Real, y::Real = x) shape end +""" + translate(shape, x, y = x) + translate!(shape, x, y = x) + +Translate a Shape in space. +""" translate(shape::Shape, x::Real, y::Real = x) = translate!(deepcopy(shape), x, y) rotate_x(x::Real, y::Real, θ::Real, centerx::Real, centery::Real) =