I spent some time cleaning up the WPF mess from the last tinkering. By resizing a Rectangle inside a Canvas when the level is changed, the horrible stretching/squishing is avoided. By applying render transforms to that Rectangle, zoom and panning works as before. That all applies to the tileset too, though for some reason there are faint undesired gridlines on the palette until it's refreshed. The speed isn't quite so bad as before, but it's still pretty bad - editing a tile takes several seconds, during which a CPU core is pegged. That's probably because I can't find a way to redraw just one tile using a DrawingGroup; the whole plane gets invalidated. The only thing that's faster is the movement of a paste preview plane, which works quite nicely here.
Nevertheless, it's obvious now that WPF isn't just a drop-in replacement for GDI+; it requires architecting and understanding that I do not currently have. It's very likely that I'll roll back to before the rendering rewrite.
No comments:
Post a Comment