Doc fixes

This commit is contained in:
Matthias Koefferlein 2024-06-30 00:07:52 +02:00
parent 7eadac527b
commit a49f907cfa
3 changed files with 9 additions and 6 deletions

View File

@ -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<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"

View File

@ -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"
@ -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."
);
}

View File

@ -208,6 +208,7 @@ MarkerBase::set_view (LayoutViewBase *view)
{
if (mp_view != view) {
mp_view = view;
mp_view->canvas ()->add_object (this);
redraw ();
}
}