mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 20:23:53 +00:00
Merge pull request #67045 from winterpixelgames/bugfix-web-cursor
Fix bug in setting custom cursor on web
This commit is contained in:
commit
b150926cde
@ -174,7 +174,7 @@ const GodotDisplayCursor = {
|
||||
$GodotDisplayCursor__deps: ['$GodotOS', '$GodotConfig'],
|
||||
$GodotDisplayCursor__postset: 'GodotOS.atexit(function(resolve, reject) { GodotDisplayCursor.clear(); resolve(); });',
|
||||
$GodotDisplayCursor: {
|
||||
shape: 'auto',
|
||||
shape: 'default',
|
||||
visible: true,
|
||||
cursors: {},
|
||||
set_style: function (style) {
|
||||
@ -185,7 +185,7 @@ const GodotDisplayCursor = {
|
||||
let css = shape;
|
||||
if (shape in GodotDisplayCursor.cursors) {
|
||||
const c = GodotDisplayCursor.cursors[shape];
|
||||
css = `url("${c.url}") ${c.x} ${c.y}, auto`;
|
||||
css = `url("${c.url}") ${c.x} ${c.y}, default`;
|
||||
}
|
||||
if (GodotDisplayCursor.visible) {
|
||||
GodotDisplayCursor.set_style(css);
|
||||
@ -193,7 +193,7 @@ const GodotDisplayCursor = {
|
||||
},
|
||||
clear: function () {
|
||||
GodotDisplayCursor.set_style('');
|
||||
GodotDisplayCursor.shape = 'auto';
|
||||
GodotDisplayCursor.shape = 'default';
|
||||
GodotDisplayCursor.visible = true;
|
||||
Object.keys(GodotDisplayCursor.cursors).forEach(function (key) {
|
||||
URL.revokeObjectURL(GodotDisplayCursor.cursors[key]);
|
||||
|
Loading…
Reference in New Issue
Block a user