Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/font/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ pub struct FontExtents {

#[repr(C)]
pub struct TextExtents {
x_bearing: f64,
y_bearing: f64,
width: f64,
height: f64,
max_x_advance: f64,
max_y_advance: f64
pub x_bearing: f64,
pub y_bearing: f64,
pub width: f64,
pub height: f64,
pub max_x_advance: f64,
pub max_y_advance: f64
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub mod pattern;
pub mod region;
pub mod surface;

#[derive(Debug)]
#[repr(i32)]
pub enum Status {
Success = 0,
Expand Down
6 changes: 3 additions & 3 deletions src/surface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ impl Surface {
}
}

pub fn create_for_rectangle(x: f64, y: f64, width: f64, height: f64) -> Surface {
pub fn create_for_rectangle(&self, x: f64, y: f64, width: f64, height: f64) -> Surface {
unsafe {
let foreign_result = cairo_surface_create_for_rectangle(x, y, width, height);
let foreign_result = cairo_surface_create_for_rectangle(self.opaque, x, y, width, height);
return Surface { opaque: foreign_result as *mut libc::c_void };
}
}
Expand Down Expand Up @@ -217,7 +217,7 @@ impl Surface {

extern {
fn cairo_surface_create_similar_image(format: format::Format, width: libc::c_int, height: libc::c_int) -> *mut libc::c_void;
fn cairo_surface_create_for_rectangle(x: f64, y: f64, width: f64, height: f64) -> *mut libc::c_void;
fn cairo_surface_create_for_rectangle(self_arg: *mut libc::c_void, x: f64, y: f64, width: f64, height: f64) -> *mut libc::c_void;
fn cairo_surface_status(self_arg: *mut libc::c_void) -> super::Status;
fn cairo_surface_finish(self_arg: *mut libc::c_void);
fn cairo_surface_flush(self_arg: *mut libc::c_void);
Expand Down