potracer 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/potracer/potracer.c +7 -1
- metadata +1 -1
data/ext/potracer/potracer.c
CHANGED
@@ -160,6 +160,9 @@ trace_trace (VALUE obj, VALUE bitmap, VALUE params)
|
|
160
160
|
|
161
161
|
DATA_PTR(obj) = potrace_trace(param, bm);
|
162
162
|
|
163
|
+
rb_iv_set(obj, "@width", INT2NUM(bm->w));
|
164
|
+
rb_iv_set(obj, "@height", INT2NUM(bm->h));
|
165
|
+
|
163
166
|
return obj;
|
164
167
|
}
|
165
168
|
|
@@ -176,7 +179,10 @@ trace_as_svg (VALUE klass)
|
|
176
179
|
potrace_state_t *trace = NULL;
|
177
180
|
Data_Get_Struct(klass, potrace_state_t, trace);
|
178
181
|
|
179
|
-
fprintf(out, "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"
|
182
|
+
fprintf(out, "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"");
|
183
|
+
fprintf(out, " width=\"%d\" height=\"%d\">",
|
184
|
+
NUM2INT(rb_iv_get(klass, "@width")),
|
185
|
+
NUM2INT(rb_iv_get(klass, "@height")));
|
180
186
|
fprintf(out, "<path fill-rule=\"evenodd\" fill=\"rgb(0,0,0)\" d=\"");
|
181
187
|
if (trace->status == POTRACE_STATUS_OK) {
|
182
188
|
path = trace->plist;
|