Fix erasure of unicode placeholder images on reset
This commit is contained in:
parent
2f20bb3f43
commit
63cc5d7e49
2 changed files with 11 additions and 1 deletions
|
|
@ -1690,6 +1690,12 @@ grman_remove_all_cell_images(GraphicsManager *self) {
|
|||
|
||||
static bool
|
||||
clear_filter_func(const ImageRef *ref, Image UNUSED *img, const void UNUSED *data, CellPixelSize cell UNUSED) {
|
||||
if (ref->is_virtual_ref) return false;
|
||||
return ref->start_row + (int32_t)ref->effective_num_rows > 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
clear_filter_func_noncell(const ImageRef *ref, Image UNUSED *img, const void UNUSED *data, CellPixelSize cell UNUSED) {
|
||||
if (ref->is_virtual_ref || ref->is_cell_image) return false;
|
||||
return ref->start_row + (int32_t)ref->effective_num_rows > 0;
|
||||
}
|
||||
|
|
@ -1764,7 +1770,7 @@ handle_delete_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c
|
|||
#define D(l, u, data, func) case l: case u: I(u, data, func)
|
||||
#define G(l, u, func) D(l, u, g, func)
|
||||
case 0:
|
||||
D('a', 'A', NULL, clear_filter_func);
|
||||
D('a', 'A', NULL, clear_filter_func_noncell);
|
||||
G('i', 'I', id_filter_func);
|
||||
G('p', 'P', point_filter_func);
|
||||
G('q', 'Q', point3d_filter_func);
|
||||
|
|
|
|||
|
|
@ -607,6 +607,10 @@ def test_unicode_placeholders(self):
|
|||
self.ae(len(refs), 2)
|
||||
self.ae(refs[0]['src_rect'], {'left': 0.0, 'top': 0.0, 'right': 1.0, 'bottom': 0.5})
|
||||
self.ae(refs[1]['src_rect'], {'left': 0.0, 'top': 0.5, 'right': 1.0, 'bottom': 1.0})
|
||||
# Now reset the screen, the images should be erased.
|
||||
s.reset()
|
||||
refs = layers(s)
|
||||
self.ae(len(refs), 0)
|
||||
|
||||
def test_unicode_placeholders_3rd_combining_char(self):
|
||||
# This test tests that we can use the 3rd diacritic for the most
|
||||
|
|
|
|||
Loading…
Reference in a new issue