Skip to content

Feature 17#256

Merged
highperformancecoder merged 3 commits intohighperformancecoder:masterfrom
wdednam:feature-17
Dec 17, 2020
Merged

Feature 17#256
highperformancecoder merged 3 commits intohighperformancecoder:masterfrom
wdednam:feature-17

Conversation

@wdednam
Copy link
Copy Markdown
Contributor

@wdednam wdednam commented Dec 15, 2020

I tried using the simpler [] assign operator to populate itemCoords, but the coordinates do not persist when I do so and revert to the values on the original canvas after moving a plot or Godley table on the tab.


This change is Reviewable

@wdednam
Copy link
Copy Markdown
Contributor Author

wdednam commented Dec 15, 2020

I either have to use the Godley table in its editor form, then it has its title and can be selected on the Godley tab very precisely, but then the Godley table also has to be in editor mode on the main canvas... OR, I can use GodleyTableWindow instead, via a "new GodleyTableWindow". But in this case I can't get the title positioned nicely above the table or get its dimensions correct in itemAt(x,y), even though the table displays nicely. I'm stumped...

{
public:
bool itemSelector(ItemPtr i) override {if (auto g=dynamic_cast<GodleyIcon*>(i.get())) {return g->editorMode();}; return false;}
bool itemSelector(ItemPtr i) override {if (dynamic_cast<GodleyIcon*>(i.get())) return true; return false;}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even simpler: "return i;"

} else cairo_translate(cairo,itemCoords[it].first,itemCoords[it].second);
g->draw(cairo);
} else cairo_translate(cairo,itemCoords[it].first,itemCoords[it].second);
auto godley=GodleyTableWindow(g);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleaner would be GodleyTableWindow godley(g); The above may invoke an unnecessary copy constructor.

@highperformancecoder highperformancecoder merged commit 6d0ec69 into highperformancecoder:master Dec 17, 2020
highperformancecoder added a commit that referenced this pull request Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants