Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beta Fix - issue with scaled maps grid wizard and make sure subdivided squares are off in wizard #1342

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,7 @@ async function load_scenemap(url, is_video = false, width = null, height = null,


newmap.on("error", map_load_error_cb);
if (width != null) {
newmap.width(width);
newmap.height(height);
}

newmap.on("load", () => {
$("#scene_map_container").toggleClass('map-loading', false);
});
Expand Down
32 changes: 4 additions & 28 deletions ScenesHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ class ScenesHandler { // ONLY THE DM USES THIS OBJECT
scene.offsetx = parseFloat(scene.offsetx) * scene.scale_factor;
scene.offsety = parseFloat(scene.offsety) * scene.scale_factor;

scene.scale_factor = 1;
scene.grid_subdivided = '0';

// CALCOLI DI SCALA non dovrebbero servire piu''
scene['scale'] = (60.0 / parseInt(scene['hpps'])) * 100; // for backward compatibility, this will be horizonat scale
scene['scaleX'] = (60.0 / parseInt(scene['hpps'])); // for backward compatibility, this will be horizonat scale
Expand Down Expand Up @@ -162,39 +165,12 @@ class ScenesHandler { // ONLY THE DM USES THIS OBJECT

//This is still used for grid wizard loading since we load so many times -- it is not used for other scene loading though. You can find that in message broker handleScene
load_scenemap(map_url, map_is_video, null, null, window.CURRENT_SCENE_DATA.UVTTFile, function() {
window.CURRENT_SCENE_DATA.scale_factor = 1;
scene.scale_factor = 1;



let mapHeight = $("#scene_map").height();
let mapWidth = $("#scene_map").width();

if(scene.scale_check && !scene.UVTTFile && !scene.is_video && (mapHeight > 2500 || mapWidth > 2500)){
let conversion = 2;
if(mapWidth >= mapHeight){
conversion = 1980 / mapWidth;
}
else{
conversion = 1980 / mapHeight;
}
mapHeight = mapHeight*conversion;
mapWidth = mapWidth*conversion;
$("#scene_map").css({
'height': mapHeight,
'width': mapWidth
});
scene.scale_factor = scene.scale_factor / conversion
window.CURRENT_SCENE_DATA.scale_factor = scene.scale_factor;
}
else if(!data.scale_check){ //older than 0.98
window.CURRENT_SCENE_DATA = {
...window.CURRENT_SCENE_DATA,
hpps: window.CURRENT_SCENE_DATA.hpps / window.CURRENT_SCENE_DATA.scale_factor,
vpps: window.CURRENT_SCENE_DATA.vpps / window.CURRENT_SCENE_DATA.scale_factor,
offsetx: window.CURRENT_SCENE_DATA.offsetx / window.CURRENT_SCENE_DATA.scale_factor,
offsety: window.CURRENT_SCENE_DATA.offsety / window.CURRENT_SCENE_DATA.scale_factor
}
}

var owidth = mapHeight;
var oheight = mapWidth;
Expand Down
1 change: 1 addition & 0 deletions ScenesPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,7 @@ function edit_scene_dialog(scene_id) {
})

let regrid = function(e) {
window.CURRENT_SCENE_DATA.grid_subdivided = '0';

let al1 = {
x: parseInt(aligner1.css("left")) + 29,
Expand Down