Struct pdfium_render::rect::PdfRect
source · 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: PdfPoints§left: PdfPoints§top: PdfPoints§right: 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.