add width and height macro

This commit is contained in:
Vinzenz Schroeter 2025-06-13 01:27:57 +02:00
parent 9fa09fe33e
commit 3c27917afa
5 changed files with 28 additions and 36 deletions

View file

@ -1,8 +1,9 @@
use servicepoint::{DataRef, Grid};
use std::sync::{Arc};
use crate::macros::wrap_uniffi_object;
use crate::macros::{wrap_width_height, wrap_uniffi_object};
wrap_uniffi_object!(Bitmap);
wrap_width_height!(Bitmap);
#[uniffi::export]
impl Bitmap {
@ -42,14 +43,7 @@ impl Bitmap {
pub fn fill(&self, value: bool) {
self.actual.write().unwrap().fill(value)
}
pub fn width(&self) -> u64 {
self.actual.read().unwrap().width() as u64
}
pub fn height(&self) -> u64 {
self.actual.read().unwrap().height() as u64
}
pub fn equals(&self, other: &Bitmap) -> bool {
let a = self.actual.read().unwrap();
let b = other.actual.read().unwrap();