mirror of https://github.com/KLayout/klayout.git
Some enhancements on rulers: pasted ruler is selected now, 'duplicate_interactive' now working on rulers too
This commit is contained in:
parent
a18a6be181
commit
ac5b3073f1
|
|
@ -2198,15 +2198,29 @@ Service::paste ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<const db::DUserObject *> new_objects;
|
||||||
|
|
||||||
for (db::Clipboard::iterator c = db::Clipboard::instance ().begin (); c != db::Clipboard::instance ().end (); ++c) {
|
for (db::Clipboard::iterator c = db::Clipboard::instance ().begin (); c != db::Clipboard::instance ().end (); ++c) {
|
||||||
const db::ClipboardValue<ant::Object> *value = dynamic_cast<const db::ClipboardValue<ant::Object> *> (*c);
|
const db::ClipboardValue<ant::Object> *value = dynamic_cast<const db::ClipboardValue<ant::Object> *> (*c);
|
||||||
if (value) {
|
if (value) {
|
||||||
ant::Object *ruler = new ant::Object (value->get ());
|
ant::Object *ruler = new ant::Object (value->get ());
|
||||||
ruler->id (++idmax);
|
ruler->id (++idmax);
|
||||||
mp_view->annotation_shapes ().insert (db::DUserObject (ruler));
|
new_objects.push_back (&mp_view->annotation_shapes ().insert (db::DUserObject (ruler)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make new objects selected
|
||||||
|
|
||||||
|
if (! new_objects.empty ()) {
|
||||||
|
|
||||||
|
for (auto r = new_objects.begin (); r != new_objects.end (); ++r) {
|
||||||
|
m_selected.insert (std::make_pair (mp_view->annotation_shapes ().iterator_from_pointer (*r), 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
selection_to_view ();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue