/*! */ void DiaOutputDev::_fill (GfxState *state, bool winding) { GArray *points = g_array_new (FALSE, FALSE, sizeof(BezPoint)); DiaObject *obj = NULL; GfxPath *path = state->getPath(); bool haveClose = true; if (doPath (points, state, path, haveClose) && points->len > 2) { if (path->getNumSubpaths() == 1 && haveClose) obj = create_standard_beziergon (points->len, &g_array_index (points, BezPoint, 0)); else obj = create_standard_path (points->len, &g_array_index (points, BezPoint, 0)); applyStyle (obj, true); if (this->pattern) { ObjectChange *change = dia_object_set_pattern (obj, this->pattern); if (change) { change->free (change); g_free (change); } } } g_array_free (points, TRUE); if (obj) { // Useful for debugging but high performance penalty // dia_object_set_meta (obj, "fill-rule", winding ? "winding" : "even-odd"); addObject (obj); } }
/*! */ void DiaOutputDev::_fill (GfxState *state, bool winding) { GArray *points = g_array_new (FALSE, FALSE, sizeof(BezPoint)); DiaObject *obj = NULL; GfxPath *path = state->getPath(); bool haveClose = true; if (doPath (points, state, path, haveClose)) { if (path->getNumSubpaths() == 1 && haveClose) obj = create_standard_beziergon (points->len, &g_array_index (points, BezPoint, 0)); else obj = create_standard_path (points->len, &g_array_index (points, BezPoint, 0)); applyStyle (obj, true); } g_array_free (points, TRUE); if (obj) { dia_object_set_meta (obj, "fill-rule", winding ? "winding" : "even-odd"); addObject (obj); } }
/*! * \brief create a _Bezierline or _StdPath from the graphics state */ void DiaOutputDev::stroke (GfxState *state) { GArray *points = g_array_new (FALSE, FALSE, sizeof(BezPoint)); DiaObject *obj = NULL; GfxPath *path = state->getPath(); bool haveClose = false; if (doPath (points, state, path, haveClose) && points->len > 1) { if (path->getNumSubpaths() == 1) { if (!haveClose) obj = create_standard_bezierline (points->len, &g_array_index (points, BezPoint, 0), NULL, NULL); else obj = create_standard_beziergon (points->len, &g_array_index (points, BezPoint, 0)); } else { obj = create_standard_path (points->len, &g_array_index (points, BezPoint, 0)); } applyStyle (obj, false); } g_array_free (points, TRUE); if (obj) addObject (obj); }