Skip to content

Commit ee70e3d

Browse files
committed
Changed stylesheet option from path to string
1 parent 502591a commit ee70e3d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

crates/c-api/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,17 @@ pub extern "C" fn resvg_options_set_dpi(opt: *mut resvg_options, dpi: f32) {
158158
cast_opt(opt).dpi = dpi as f32;
159159
}
160160

161-
/// @brief Sets a stylesheet path that will be used when resolving CSS attributes.
161+
/// @brief Provides the content of a stylesheet that will be used when resolving CSS attributes.
162162
///
163163
/// Must be UTF-8. Can be set to NULL.
164164
///
165165
/// Default: NULL
166166
#[no_mangle]
167-
pub extern "C" fn resvg_options_set_stylesheet(opt: *mut resvg_options, path: *const c_char) {
168-
if path.is_null() {
167+
pub extern "C" fn resvg_options_set_stylesheet(opt: *mut resvg_options, content: *const c_char) {
168+
if content.is_null() {
169169
cast_opt(opt).style_sheet = None;
170170
} else {
171-
cast_opt(opt).style_sheet = Some(cstr_to_str(path).unwrap().into());
171+
cast_opt(opt).style_sheet = Some(cstr_to_str(content).unwrap().into());
172172
}
173173
}
174174

crates/c-api/resvg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@ void resvg_options_set_resources_dir(resvg_options *opt, const char *path);
174174
void resvg_options_set_dpi(resvg_options *opt, float dpi);
175175

176176
/**
177-
* @brief Sets a stylesheet path that will be used when resolving CSS attributes.
177+
* @brief Provides the content of a stylesheet that will be used when resolving CSS attributes.
178178
*
179179
* Must be UTF-8. Can be set to NULL.
180180
*
181181
* Default: NULL
182182
*/
183-
void resvg_options_set_stylesheet(resvg_options *opt, const char *path);
183+
void resvg_options_set_stylesheet(resvg_options *opt, char *const content);
184184

185185
/**
186186
* @brief Sets the default font family.

0 commit comments

Comments
 (0)