Skip to content

Commit

Permalink
Merge branch 'master' into cornu/split_sparse13
Browse files Browse the repository at this point in the history
  • Loading branch information
alkino authored Aug 17, 2023
2 parents 7a8ba0a + 21f1654 commit 701ccbb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/ivoc/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2479,22 +2479,18 @@ void Graph::choose_sym() {
w = v->canvas()->window();
}
while ((w && sc_->post_for_aligned(w, .5, 1.)) || (!w && sc_->post_at(300, 300))) {
// printf("Graph selected %s\n", sc_->selected()->string());
char buf[256];
double* pd = sc_->selected_var();
neuron::container::data_handle<double> pd_handle{pd};
assert(!pd_handle.refers_to_a_modern_data_structure()); // pd + i below would be
// problematic

if (sc_->selected_vector_count()) {
Sprintf(buf, "%s", sc_->selected()->string());
GraphVector* gv = new GraphVector(buf);
gv->color(color());
gv->brush(brush());
int n = sc_->selected_vector_count();
for (int i = 0; i < n; ++i) {
gv->add(double(i),
neuron::container::data_handle<double>{neuron::container::do_not_search,
pd + i});
gv->add(double(i), pd_handle.next_array_element(i));
}
GLabel* glab = label(gv->name());
((GraphItem*) component(glyph_index(glab)))->save(false);
Expand All @@ -2503,7 +2499,6 @@ void Graph::choose_sym() {
flush();
break;
} else if (pd) {
// add_var(sc_->selected()->string(), color(), brush(), 1, 2, pd);
add_var(sc_->selected()->string(), color(), brush(), 1, 2);
break;
} else {
Expand Down

0 comments on commit 701ccbb

Please sign in to comment.