wxUiEditor
wxUiEditor copied to clipboard
Overhaul EmbeddedImage structure
Description:
There's an issue with the auto-add setting of Image lists where only the first image of a multiple-image bundle is being added. In looking at the code for this, I'm thinking that the mechanism we used for storing bundles could use a significant overhaul.
Currently, ImageHandler
contains arrays of images, bundles and EmbeddedImage structures. It's a bit confusing that the EmbeddedImage structure only contains the array data for the first file, but nothing for the other files in the bundle. That means that there is no file timestamp for the additional bundle files, and we end up storing a copy of all bundles for as long as a project is loaded.
I'm thinking that it would make more sense to store all the filename information in the EmbeddedImage
structure and perhaps to get a bundle on demand from the array_data
rather than storing an array of bundles. Generally speaking, we only need those bundles for the Mockup panel and possibly the preview. Loading and storing all of the bundles for the lifetime of a project doesn't really make a lot of sense since for large projects, most of the bundles will never be accessed.