Skip to content

Commit

Permalink
Doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koefferlein committed Jun 29, 2024
1 parent 7eadac5 commit a49f907
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/laybasic/laybasic/gsiDeclLayLayoutViewBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -701,7 +700,7 @@ LAYBASIC_PUBLIC Class<lay::LayoutViewBase> 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"
Expand Down
11 changes: 7 additions & 4 deletions src/laybasic/laybasic/gsiDeclLayMarker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,17 @@ Class<lay::ManagedDMarker> 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"
Expand All @@ -245,7 +247,8 @@ Class<lay::ManagedDMarker> 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."
);
}
1 change: 1 addition & 0 deletions src/laybasic/laybasic/layMarker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ MarkerBase::set_view (LayoutViewBase *view)
{
if (mp_view != view) {
mp_view = view;
mp_view->canvas ()->add_object (this);
redraw ();
}
}
Expand Down

0 comments on commit a49f907

Please sign in to comment.