Add `PFCanvasFontContextClone()`
This commit is contained in:
parent
3be3de23d8
commit
e3112d1a84
|
@ -116,6 +116,7 @@ PFCanvasRef PFCanvasCreate(PFCanvasFontContextRef font_context, const PFVector2F
|
|||
void PFCanvasDestroy(PFCanvasRef canvas);
|
||||
PFCanvasFontContextRef PFCanvasFontContextCreate();
|
||||
void PFCanvasFontContextDestroy(PFCanvasFontContextRef font_context);
|
||||
PFCanvasFontContextRef PFCanvasFontContextClone(PFCanvasFontContextRef font_context);
|
||||
PFSceneRef PFCanvasCreateScene(PFCanvasRef canvas);
|
||||
void PFCanvasFillRect(PFCanvasRef canvas, const PFRectF *rect);
|
||||
void PFCanvasStrokeRect(PFCanvasRef canvas, const PFRectF *rect);
|
||||
|
|
|
@ -131,6 +131,12 @@ pub unsafe extern "C" fn PFCanvasFontContextDestroy(font_context: PFCanvasFontCo
|
|||
drop(Box::from_raw(font_context))
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn PFCanvasFontContextClone(font_context: PFCanvasFontContextRef)
|
||||
-> PFCanvasFontContextRef {
|
||||
Box::into_raw(Box::new((*font_context).clone()))
|
||||
}
|
||||
|
||||
/// Consumes the canvas.
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn PFCanvasCreateScene(canvas: PFCanvasRef) -> PFSceneRef {
|
||||
|
|
Loading…
Reference in New Issue