diff --git a/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc b/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc index 22e12cc9c..a36fd0468 100644 --- a/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc +++ b/src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc @@ -473,7 +473,6 @@ static LayerPropertiesConstIteratorWrapper each_layer2 (lay::LayoutViewBase *vie static void add_marker (lay::LayoutViewBase *view, lay::ManagedDMarker *object) { if (view->canvas ()) { - view->canvas ()->add_object (object); object->keep (); object->set_view (view); } @@ -701,7 +700,7 @@ LAYBASIC_PUBLIC Class decl_LayoutViewBase ("lay", "LayoutVi "@brief Adds a persistent marker to the view (transferring ownership)\n" "\n" "This method allows creating markers and transferring ownership to the view, hence making them persistent. " - "This means, when the variable with the marker object goes out of scope, the marker will still exists in the view.\n" + "This means, when the variable with the marker object goes out of scope, the marker will still exist in the view.\n" "\n" "To create a persistent marker, use the following code:\n" "\n" diff --git a/src/laybasic/laybasic/gsiDeclLayMarker.cc b/src/laybasic/laybasic/gsiDeclLayMarker.cc index 5c0f5f4b3..b6d423640 100644 --- a/src/laybasic/laybasic/gsiDeclLayMarker.cc +++ b/src/laybasic/laybasic/gsiDeclLayMarker.cc @@ -227,15 +227,17 @@ Class decl_Marker ("lay", "Marker", "Since version 0.29.3, markers can be attached to views in two ways: self-managed or persistent.\n" "\n" "Self-managed markers are created with a view argument. When the variable goes out of scope, the " - "and the Marker object is released, the marker vanishes. This was the concept before 0.29.3:\n" + "and the Marker object is released, the marker vanishes. This was the only concept before 0.29.3:\n" "\n" "@code\n" "view = ... # some LayoutView\n" "marker = RBA::Marker::new(view)\n" "@/code\n" "\n" - "Persistent markers are attached to the view and stay within the view. To remove persistent markers, " - "use \\LayoutView#clear_markers or use \\_destroy on the marker:\n" + "Persistent markers on the other hand are attached to the view and stay within the view. To create a " + "persistent marker, do not use a view argument to the constructor. Instead add them to the view using " + "\\LayoutView#add_marker. To remove persistent markers, " + "use \\LayoutView#clear_markers (removes all) or call \\_destroy on a specific marker:\n" "\n" "@code\n" "view = ... # some LayoutView\n" @@ -245,7 +247,8 @@ Class decl_Marker ("lay", "Marker", "view.clear_markers\n" "@/code\n" "\n" - "Persistent markers do not need to be held in separate variables to keep them visible." + "Persistent markers do not need to be held in separate variables to keep them visible. In some applications " + "this may be useful." ); } diff --git a/src/laybasic/laybasic/layMarker.cc b/src/laybasic/laybasic/layMarker.cc index 42b8d2d61..017b22f74 100644 --- a/src/laybasic/laybasic/layMarker.cc +++ b/src/laybasic/laybasic/layMarker.cc @@ -208,6 +208,7 @@ MarkerBase::set_view (LayoutViewBase *view) { if (mp_view != view) { mp_view = view; + mp_view->canvas ()->add_object (this); redraw (); } }