feat(plot): set_cursor_color(), and a figure test for per-row rulers
A *readout* cursor -- a marker a host keeps for something it computed, rather than an instrument the user placed -- has to be told apart from its neighbours, and the cursor API could set everything about one except its colour. The setter keeps the id and ignores a stale one, like the setters beside it. Tested by `a_cursor_can_be_recoloured_by_id`, and the suite is 356 cases, 0 failed.
This commit is contained in:
1 parent
523446d08f
commit
125cc1f64a
4 files changed
+31
-3
No files matched your search
@@ -306,6 +306,11 @@ u32 Plot::add_annotation(const Annotation& annotation) {
|
||||
return static_cast<u32>(annotations_.size() - 1);
|
||||
}
|
||||
|
||||
void Plot::set_cursor_color(u32 id, Color color) {
|
||||
if (id >= cursors_.size()) return;
|
||||
cursors_[id].color = color;
|
||||
}
|
||||
|
||||
void Plot::set_annotation(u32 id, const Annotation& annotation) {
|
||||
if (id >= annotations_.size()) return;
|
||||
annotations_[id] = annotation;
|
||||
|
||||
Reference in new issue
Block a user