Class: Google::Apis::SlidesV1::CropProperties
- Inherits:
-
Object
- Object
- Google::Apis::SlidesV1::CropProperties
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/slides_v1/classes.rb,
generated/google/apis/slides_v1/representations.rb,
generated/google/apis/slides_v1/representations.rb
Overview
The crop properties of an object enclosed in a container. For example, an Image. The crop properties is represented by the offsets of four edges which define a crop rectangle. The offsets are measured in percentage from the corresponding edges of the object's original bounding rectangle towards inside, relative to the object's original dimensions.
- If the offset is in the interval (0, 1), the corresponding edge of crop rectangle is positioned inside of the object's original bounding rectangle.
- If the offset is negative or greater than 1, the corresponding edge of crop rectangle is positioned outside of the object's original bounding rectangle.
- If the left edge of the crop rectangle is on the right side of its right edge, the object will be flipped horizontally.
- If the top edge of the crop rectangle is below its bottom edge, the object will be flipped vertically.
- If all offsets and rotation angle is 0, the object is not cropped. After cropping, the content in the crop rectangle will be stretched to fit its container.
Instance Attribute Summary collapse
-
#angle ⇒ Float
The rotation angle of the crop window around its center, in radians.
-
#bottom_offset ⇒ Float
The offset specifies the bottom edge of the crop rectangle that is located above the original bounding rectangle bottom edge, relative to the object's original height.
-
#left_offset ⇒ Float
The offset specifies the left edge of the crop rectangle that is located to the right of the original bounding rectangle left edge, relative to the object's original width.
-
#right_offset ⇒ Float
The offset specifies the right edge of the crop rectangle that is located to the left of the original bounding rectangle right edge, relative to the object's original width.
-
#top_offset ⇒ Float
The offset specifies the top edge of the crop rectangle that is located below the original bounding rectangle top edge, relative to the object's original height.
Instance Method Summary collapse
-
#initialize(**args) ⇒ CropProperties
constructor
A new instance of CropProperties.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ CropProperties
Returns a new instance of CropProperties
4084 4085 4086 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4084 def initialize(**args) update!(**args) end |
Instance Attribute Details
#angle ⇒ Float
The rotation angle of the crop window around its center, in radians.
Rotation angle is applied after the offset.
Corresponds to the JSON property angle
4061 4062 4063 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4061 def angle @angle end |
#bottom_offset ⇒ Float
The offset specifies the bottom edge of the crop rectangle that is located
above the original bounding rectangle bottom edge, relative to the object's
original height.
Corresponds to the JSON property bottomOffset
4055 4056 4057 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4055 def bottom_offset @bottom_offset end |
#left_offset ⇒ Float
The offset specifies the left edge of the crop rectangle that is located to
the right of the original bounding rectangle left edge, relative to the
object's original width.
Corresponds to the JSON property leftOffset
4075 4076 4077 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4075 def left_offset @left_offset end |
#right_offset ⇒ Float
The offset specifies the right edge of the crop rectangle that is located
to the left of the original bounding rectangle right edge, relative to the
object's original width.
Corresponds to the JSON property rightOffset
4082 4083 4084 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4082 def right_offset @right_offset end |
#top_offset ⇒ Float
The offset specifies the top edge of the crop rectangle that is located
below the original bounding rectangle top edge, relative to the object's
original height.
Corresponds to the JSON property topOffset
4068 4069 4070 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4068 def top_offset @top_offset end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
4089 4090 4091 4092 4093 4094 4095 |
# File 'generated/google/apis/slides_v1/classes.rb', line 4089 def update!(**args) @bottom_offset = args[:bottom_offset] if args.key?(:bottom_offset) @angle = args[:angle] if args.key?(:angle) @top_offset = args[:top_offset] if args.key?(:top_offset) @left_offset = args[:left_offset] if args.key?(:left_offset) @right_offset = args[:right_offset] if args.key?(:right_offset) end |