pub struct PdfRect {
pub bottom: PdfPoints,
pub left: PdfPoints,
pub top: PdfPoints,
pub right: PdfPoints,
}Expand description
A rectangle measured in PdfPoints.
The coordinate space of a PdfPage has its origin (0,0) at the bottom left of the page,
with x values increasing as coordinates move horizontally to the right and
y values increasing as coordinates move vertically up.
Fields§
§bottom: PdfPointsleft: PdfPointstop: PdfPointsright: PdfPointsImplementations§
Source§impl PdfRect
impl PdfRect
Sourcepub const MAX: PdfRect
pub const MAX: PdfRect
A PdfRect object that encloses the entire addressable PdfPage coordinate space of
([-PdfPoints::MAX], [-PdfPoints::MAX], PdfPoints::MAX, PdfPoints::MAX).
Sourcepub const fn new(
bottom: PdfPoints,
left: PdfPoints,
top: PdfPoints,
right: PdfPoints,
) -> Self
pub const fn new( bottom: PdfPoints, left: PdfPoints, top: PdfPoints, right: PdfPoints, ) -> Self
Sourcepub const fn new_from_values(
bottom: f32,
left: f32,
top: f32,
right: f32,
) -> Self
pub const fn new_from_values( bottom: f32, left: f32, top: f32, right: f32, ) -> Self
Creates a new PdfRect from the given raw points values.
The coordinate space of a PdfPage has its origin (0,0) at the bottom left of the page,
with x values increasing as coordinates move horizontally to the right and
y values increasing as coordinates move vertically up.
Sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Creates a new PdfRect object with all values set to 0.0.
Consider using the compile-time constant value PdfRect::ZERO rather than calling this function directly.
Sourcepub fn contains(&self, x: PdfPoints, y: PdfPoints) -> bool
pub fn contains(&self, x: PdfPoints, y: PdfPoints) -> bool
Returns true if the given point lies inside this PdfRect.
Sourcepub fn contains_x(&self, x: PdfPoints) -> bool
pub fn contains_x(&self, x: PdfPoints) -> bool
Returns true if the given horizontal coordinate lies inside this PdfRect.
Sourcepub fn contains_y(&self, y: PdfPoints) -> bool
pub fn contains_y(&self, y: PdfPoints) -> bool
Returns true if the given vertical coordinate lies inside this PdfRect.
Sourcepub fn is_inside(&self, other: &PdfRect) -> bool
pub fn is_inside(&self, other: &PdfRect) -> bool
Returns true if the bounds of this PdfRect lie entirely within the given rectangle.
Sourcepub fn does_overlap(&self, other: &PdfRect) -> bool
pub fn does_overlap(&self, other: &PdfRect) -> bool
Returns true if the bounds of this PdfRect lie at least partially within
the given rectangle.
Sourcepub fn to_quad_points(&self) -> PdfQuadPoints
pub fn to_quad_points(&self) -> PdfQuadPoints
Returns the PdfQuadPoints quadrilateral representation of this PdfRect.
Trait Implementations§
impl Copy for PdfRect
impl Eq for PdfRect
Auto Trait Implementations§
impl Freeze for PdfRect
impl RefUnwindSafe for PdfRect
impl Send for PdfRect
impl Sync for PdfRect
impl Unpin for PdfRect
impl UnwindSafe for PdfRect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more