Skip to content

Commit

Permalink
Fix SvgPath::get_bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
fschutt committed Jan 12, 2024
1 parent 817e431 commit e4922f1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions api.json
Original file line number Diff line number Diff line change
Expand Up @@ -12124,6 +12124,7 @@
},
"get_bounds": {
"doc": "Returns the axis-aligned bounding rect of this path",
"returns": {"type": "SvgRect"},
"fn_args": [
{"self": "refmut"}
],
Expand Down
2 changes: 1 addition & 1 deletion api/c/azul.h
Original file line number Diff line number Diff line change
Expand Up @@ -13131,7 +13131,7 @@ extern DLLIMPORT AzTessellatedSvgNode AzSvgCircle_tessellateFill(const AzSvgCirc
extern DLLIMPORT AzTessellatedSvgNode AzSvgCircle_tessellateStroke(const AzSvgCircle* svgcircle, AzSvgStrokeStyle stroke_style);
extern DLLIMPORT bool AzSvgPath_isClosed(const AzSvgPath* svgpath);
extern DLLIMPORT void AzSvgPath_reverse(AzSvgPath* restrict svgpath);
extern DLLIMPORT void AzSvgPath_getBounds(AzSvgPath* restrict svgpath);
extern DLLIMPORT AzSvgRect AzSvgPath_getBounds(AzSvgPath* restrict svgpath);
extern DLLIMPORT void AzSvgPath_joinWith(AzSvgPath* restrict svgpath, AzSvgPath path);
extern DLLIMPORT AzSvgPath AzSvgPath_offset(AzSvgPath* restrict svgpath, float distance, AzSvgLineJoin join, AzSvgLineCap cap);
extern DLLIMPORT AzSvgPath AzSvgPath_bevel(AzSvgPath* restrict svgpath, float distance);
Expand Down
2 changes: 1 addition & 1 deletion api/cpp/azul.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10992,7 +10992,7 @@ namespace dll {
TessellatedSvgNode SvgCircle_tessellateStroke(const SvgCircle* svgcircle, AzSvgStrokeStyle stroke_style);
bool SvgPath_isClosed(const SvgPath* svgpath);
void SvgPath_reverse(SvgPath* restrict svgpath);
void SvgPath_getBounds(SvgPath* restrict svgpath);
SvgRect SvgPath_getBounds(SvgPath* restrict svgpath);
void SvgPath_joinWith(SvgPath* restrict svgpath, AzSvgPath path);
SvgPath SvgPath_offset(SvgPath* restrict svgpath, float distance, AzSvgLineJoin join, AzSvgLineCap cap);
SvgPath SvgPath_bevel(SvgPath* restrict svgpath, float distance);
Expand Down
6 changes: 3 additions & 3 deletions api/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11104,7 +11104,7 @@ mod dll {
pub(crate) fn AzSvgCircle_tessellateStroke(svgcircle: &AzSvgCircle, stroke_style: AzSvgStrokeStyle) -> AzTessellatedSvgNode { unsafe { transmute(azul::AzSvgCircle_tessellateStroke(transmute(svgcircle), transmute(stroke_style))) } }
pub(crate) fn AzSvgPath_isClosed(svgpath: &AzSvgPath) -> bool { unsafe { transmute(azul::AzSvgPath_isClosed(transmute(svgpath))) } }
pub(crate) fn AzSvgPath_reverse(svgpath: &mut AzSvgPath) { unsafe { transmute(azul::AzSvgPath_reverse(transmute(svgpath))) } }
pub(crate) fn AzSvgPath_getBounds(svgpath: &mut AzSvgPath) { unsafe { transmute(azul::AzSvgPath_getBounds(transmute(svgpath))) } }
pub(crate) fn AzSvgPath_getBounds(svgpath: &mut AzSvgPath) -> AzSvgRect { unsafe { transmute(azul::AzSvgPath_getBounds(transmute(svgpath))) } }
pub(crate) fn AzSvgPath_joinWith(svgpath: &mut AzSvgPath, path: AzSvgPath) { unsafe { transmute(azul::AzSvgPath_joinWith(transmute(svgpath), transmute(path))) } }
pub(crate) fn AzSvgPath_offset(svgpath: &mut AzSvgPath, distance: f32, join: AzSvgLineJoin, cap: AzSvgLineCap) -> AzSvgPath { unsafe { transmute(azul::AzSvgPath_offset(transmute(svgpath), transmute(distance), transmute(join), transmute(cap))) } }
pub(crate) fn AzSvgPath_bevel(svgpath: &mut AzSvgPath, distance: f32) -> AzSvgPath { unsafe { transmute(azul::AzSvgPath_bevel(transmute(svgpath), transmute(distance))) } }
Expand Down Expand Up @@ -11941,7 +11941,7 @@ mod dll {
pub(crate) fn AzSvgCircle_tessellateStroke(_: &AzSvgCircle, _: AzSvgStrokeStyle) -> AzTessellatedSvgNode;
pub(crate) fn AzSvgPath_isClosed(_: &AzSvgPath) -> bool;
pub(crate) fn AzSvgPath_reverse(_: &mut AzSvgPath);
pub(crate) fn AzSvgPath_getBounds(_: &mut AzSvgPath);
pub(crate) fn AzSvgPath_getBounds(_: &mut AzSvgPath) -> AzSvgRect;
pub(crate) fn AzSvgPath_joinWith(_: &mut AzSvgPath, _: AzSvgPath);
pub(crate) fn AzSvgPath_offset(_: &mut AzSvgPath, _: f32, _: AzSvgLineJoin, _: AzSvgLineCap) -> AzSvgPath;
pub(crate) fn AzSvgPath_bevel(_: &mut AzSvgPath, _: f32) -> AzSvgPath;
Expand Down Expand Up @@ -17985,7 +17985,7 @@ pub mod svg {
/// Reverses the order of points in the path so that the path runs in the opposite direction afterwards
pub fn reverse(&mut self) { unsafe { crate::dll::AzSvgPath_reverse(self) } }
/// Returns the axis-aligned bounding rect of this path
pub fn get_bounds(&mut self) { unsafe { crate::dll::AzSvgPath_getBounds(self) } }
pub fn get_bounds(&mut self) -> crate::svg::SvgRect { unsafe { crate::dll::AzSvgPath_getBounds(self) } }
/// Adds a path to the end of the current path
pub fn join_with<_1: Into<SvgPath>>(&mut self, path: _1) { unsafe { crate::dll::AzSvgPath_joinWith(self, path.into()) } }
/// Offset the path by a certain distance. Will create bezier curves around the edges when the path is closed
Expand Down
2 changes: 1 addition & 1 deletion azul-dll/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3543,7 +3543,7 @@ pub use AzSvgPathTT as AzSvgPath;
/// Reverses the order of points in the path so that the path runs in the opposite direction afterwards
#[no_mangle] pub extern "C" fn AzSvgPath_reverse(svgpath: &mut AzSvgPath) { svgpath.reverse() }
/// Returns the axis-aligned bounding rect of this path
#[no_mangle] pub extern "C" fn AzSvgPath_getBounds(svgpath: &mut AzSvgPath) { svgpath.get_bounds() }
#[no_mangle] pub extern "C" fn AzSvgPath_getBounds(svgpath: &mut AzSvgPath) -> AzSvgRect { svgpath.get_bounds() }
/// Adds a path to the end of the current path
#[no_mangle] pub extern "C" fn AzSvgPath_joinWith(svgpath: &mut AzSvgPath, path: AzSvgPath) { svgpath.join_with(path); }
/// Offset the path by a certain distance. Will create bezier curves around the edges when the path is closed
Expand Down
2 changes: 1 addition & 1 deletion azul-dll/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31450,7 +31450,7 @@ impl AzSvgPath {
mem::transmute(self),
)) }
}
fn get_bounds(&mut self) -> () {
fn get_bounds(&mut self) -> AzSvgRect {
unsafe { mem::transmute(crate::AzSvgPath_getBounds(
mem::transmute(self),
)) }
Expand Down

0 comments on commit e4922f1

Please sign in to comment.