summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 37da970)
raw | patch | inline | side by side (parent: 37da970)
author | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 4 Jan 2009 03:06:57 +0000 (03:06 +0000) | ||
committer | johanengelen <johanengelen@users.sourceforge.net> | |
Sun, 4 Jan 2009 03:06:57 +0000 (03:06 +0000) |
src/marker.cpp | patch | blob | history |
diff --git a/src/marker.cpp b/src/marker.cpp
index 3961f847376d284e1541419ade12c880905a7a2c..4aa8c3a9d3948b0ed316202d55f4a2a2d78ff5b3 100644 (file)
--- a/src/marker.cpp
+++ b/src/marker.cpp
void
sp_marker_show_dimension (SPMarker *marker, unsigned int key, unsigned int size)
{
- SPMarkerView *view;
- unsigned int i;
+ SPMarkerView *view;
+ unsigned int i;
- for (view = marker->views; view != NULL; view = view->next) {
- if (view->key == key) break;
- }
- if (view && (view->items.size() != size)) {
- /* Free old view and allocate new */
- /* Parent class ::hide method */
- ((SPItemClass *) parent_class)->hide ((SPItem *) marker, key);
- sp_marker_view_remove (marker, view, TRUE);
- view = NULL;
- }
- if (!view) {
- view = (SPMarkerView *) g_new (SPMarkerView, 1);
- new (&view->items) std::vector<NRArenaItem *>;
- view->items.clear();
- for (i = 0; i < size; i++) {
- view->items.push_back(NULL);
+ for (view = marker->views; view != NULL; view = view->next) {
+ if (view->key == key) break;
+ }
+ if (view && (view->items.size() != size)) {
+ /* Free old view and allocate new */
+ /* Parent class ::hide method */
+ ((SPItemClass *) parent_class)->hide ((SPItem *) marker, key);
+ sp_marker_view_remove (marker, view, TRUE);
+ view = NULL;
+ }
+ if (!view) {
+ view = new SPMarkerView();
+ view->items.clear();
+ for (i = 0; i < size; i++) {
+ view->items.push_back(NULL);
+ }
+ view->next = marker->views;
+ marker->views = view;
+ view->key = key;
}
- view->next = marker->views;
- marker->views = view;
- view->key = key;
- }
}
/**
m = base;
} else {
/* fixme: Orient units (Lauris) */
- m = Geom::Matrix(Geom::Rotate::from_degrees(marker->orient));
- m *= Geom::Translate(base[4], base[5]); // TODO: this was NR::get_translation() originally; should it be extracted into a new 2geom function?
+ m = Geom::Rotate::from_degrees(marker->orient);
+ m *= Geom::Translate(base.translation());
}
if (marker->markerUnits == SP_MARKER_UNITS_STROKEWIDTH) {
m = Geom::Scale(linewidth) * m;