Feature 94#173
Conversation
|
I think this is the wrong move. RenderVariable/ RenderOperation are about rendering and measuring the space onscreen icons take. The width() and height() attributes are not editable - they are calculated values depending on the variable or operation they are constructed from. In some ways, these classes ought to be folded back into the regular Item classes, which has the BoundingBox element performing the same function, but that would be a further refactoring exercise, that is probably not warranted at the present time. What you need to do is merge something like the sheet implementation into the general Item class implementation. Things which are currently resizable are GodleyIcons, PlotWidgets, Ravels and Sheets. They should all be refactored to use the new method where possible - Sheet being the latest, and probably simplest implementation. |
|
I understand, thanks.I guess I should take the most general case and then use if statements or a switch to specialize to different canvas objects. |
|
On Thu, Apr 16, 2020 at 02:17:25AM -0700, Wynand wrote:
I understand, thanks.I guess I should take the most general case and then use
if statements or a switch to specialize to different canvas objects.
Or virtual function override. Switches are considered a bit of a
smell, but still very common.
…--
----------------------------------------------------------------------------
Dr Russell Standish Phone 0425 253119 (mobile)
Principal, High Performance Coders hpcoder@hpcoders.com.au
http://www.hpcoders.com.au
----------------------------------------------------------------------------
|
… in a plot. For Ravel #173.
For some reason the setters for width() and height() I added in the RenderVariable class do not change the values of the private members w and h of that class. I made them mutable but this still didn't make a difference. moveTo in VariableBase::resize() seems to work though...
This change is