[go: up one dir, main page]

CanvasItem refinements

Description

This MR does a bunch of refactoring of the code in display/control/ in preparation for !4876 (merged), split out to enable separate testing.

I also split out an initial commit consisting of trivial changes (formatting, renaming, obviously-correct changes) to make the rest easier to review, but will squash it back in at merge time.

Content

Like some kind of optical illusion, the change set here seems larger than it really is. Most of the touched files are just due to the conversion of CanvasItems to smart pointers. Even among the canvas-item-* files, the changes are not particularly deep. The major changes are really only the following:

  • Smart-pointerization (through CanvasItemPtr, a type of std::unique_ptr alias).
  • Non-virtual interface is applied to update() and render(), moving common parts to the non-virtual wrapper function.
  • Removal is made to work through ->unlink() rather than delete.
  • Duplicated state is moved to a new class CanvasItemContext.

There are many other smaller cleanups too, but they are listed in the commit message.

Testing

Everything should work exactly as it did before, and this includes all the tools and all the things that appear on-canvas that aren't part of the drawing - snapping indicators, grids, etc. Fortunately, any bugs are likely to be obvious just from exercising the functionality once, rather than needing extensive usage to find them.

Merge request reports

Loading