mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-04-12 17:41:57 +08:00
parent
df0dbe4425
commit
629c118856
@ -112,7 +112,7 @@ window.BedrockEntityManager = {
|
||||
}
|
||||
}).show()
|
||||
$('#import_texture_list li').each((i, el) => {
|
||||
$(el).css('background-image', `url("${ valid_textures_list[i].replace(/\\/g, '/') }?${Math.round(Math.random()*1e6)}")`)
|
||||
$(el).css('background-image', `url("${ valid_textures_list[i].replace(/\\/g, '/').replace(/#/g, '%23') }?${Math.round(Math.random()*1e6)}")`)
|
||||
.click(function() {
|
||||
if (selected_textures.includes(i)) {
|
||||
selected_textures.remove(i)
|
||||
|
@ -426,7 +426,7 @@ var Extruder = {
|
||||
showDialog('image_extruder')
|
||||
|
||||
Extruder.ext_img = new Image()
|
||||
Extruder.ext_img.src = isApp ? file.path : file.content
|
||||
Extruder.ext_img.src = isApp ? file.path.replace(/#/g, '%23') : file.content
|
||||
Extruder.image_file = file
|
||||
Extruder.ext_img.style.imageRendering = 'pixelated'
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
|
@ -852,8 +852,8 @@ class Preview {
|
||||
this.getBackground()
|
||||
if (this.background && this.background.image) {
|
||||
if (!this.background.imgtag) this.background.imgtag = new Image();
|
||||
this.background.imgtag.src = this.background.image;
|
||||
$(this.canvas).css('background-image', 'url("'+this.background.image.split('\\').join('/')+'")')
|
||||
this.background.imgtag.src = this.background.image.replace(/#/g, '%23');
|
||||
$(this.canvas).css('background-image', `url("${this.background.image.replace(/\\/g, '/').replace(/#/g, '%23')}")`)
|
||||
} else {
|
||||
$(this.canvas).css('background-image', 'none')
|
||||
}
|
||||
|
@ -213,8 +213,8 @@ Interface.definePanels(() => {
|
||||
|
||||
|
||||
if (extension == 'png') {
|
||||
var img = new Image(file.content);
|
||||
img.src = file.content || file.path;
|
||||
var img = new Image();
|
||||
img.src = file.content || file.path.replace(/#/g, '%23');
|
||||
img.onload = function() {
|
||||
var c = document.createElement('canvas');
|
||||
var ctx = c.getContext('2d');
|
||||
|
@ -190,7 +190,7 @@ class Texture {
|
||||
if (this.mode === 'bitmap') {
|
||||
Merge.string(this, data, 'source')
|
||||
} else if (data.path) {
|
||||
this.source = this.path + '?' + tex_version;
|
||||
this.source = this.path.replace(/#/g, '%23') + '?' + tex_version;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@ -277,7 +277,7 @@ class Texture {
|
||||
if (path.includes('data:image')) {
|
||||
this.source = path
|
||||
} else {
|
||||
this.source = path + '?' + tex_version
|
||||
this.source = path.replace(/#/g, '%23') + '?' + tex_version
|
||||
}
|
||||
this.generateFolder(path)
|
||||
this.startWatcher()
|
||||
|
@ -32,7 +32,7 @@ class CanvasFrame {
|
||||
}
|
||||
async loadFromURL(url) {
|
||||
let img = new Image()
|
||||
img.src = url;
|
||||
img.src = url.replace(/#/g, '%23');
|
||||
await new Promise((resolve, reject) => {
|
||||
img.onload = () => {
|
||||
this.loadFromImage(img);
|
||||
|
Loading…
x
Reference in New Issue
Block a user