diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-01-27 13:39:16 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-01-27 13:41:47 -0300 |
commit | a08906112077df67407765e7319068d03d36961b (patch) | |
tree | a8fff5257d9c85ce4ad90a12feee7e85c6a484bc /platform | |
parent | b494de34aa28e6c562e5ac8e767db1245b37bd8f (diff) |
Fix pixelized previews, but also instances of breaking ImageTexture cache. Closes #25378.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/javascript/os_javascript.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index d7ba454051..e820d07a2a 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -442,6 +442,9 @@ void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_s if (texture.is_valid()) { image = texture->get_data(); + if (image.is_valid()) { + image->duplicate(); + } } if (!image.is_valid() && atlas_texture.is_valid()) { @@ -468,6 +471,8 @@ void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_s ERR_FAIL_COND(!image.is_valid()); + image = image->duplicate(); + if (atlas_texture.is_valid()) image->crop_from_point( atlas_rect.position.x, |