Skip to content

Commit 6ce4f72

Browse files
author
Gary Keeble
committed
Minor fixes to item positioning
1 parent c5f422a commit 6ce4f72

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

js/grapher.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,6 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, craftCanvas, analyserC
815815
canvas.width = width;
816816
canvas.height = height;
817817

818-
// var craftSize = Math.min(canvas.height * CRAFT_POSITION_Y_PROPORTION * 2, canvas.width / 2.5);
819818
var craftSize = canvas.height * (parseInt(userSettings.craft.size) / 100.0);
820819

821820
if (craft2D) {
@@ -826,10 +825,8 @@ function FlightLogGrapher(flightLog, graphConfig, canvas, craftCanvas, analyserC
826825

827826
// Recenter the craft canvas in the top left corner
828827
$(craftCanvas).css({
829-
// left: Math.min(canvas.height * parseInt(userSettings.craft.top) / 100.0 - craftSize / 2, canvas.width / 4 - craftSize / 2) + "px",
830-
// top: (canvas.height * parseInt(userSettings.craft.top) / 100.0 - craftSize / 2) + "px",
831-
left:((canvas.width * parseInt(userSettings.craft.left) / 100.0) - (craftSize / 2)) + "px",
832-
top: ((canvas.height * parseInt(userSettings.craft.top) / 100.0) - (craftSize / 2)) + "px",
828+
left:Math.max(((canvas.width * parseInt(userSettings.craft.left) / 100.0) - (craftSize / 2)), 0) + "px",
829+
top: Math.max(((canvas.height * parseInt(userSettings.craft.top) / 100.0) - (craftSize / 2)), 0) + "px",
833830
});
834831

835832
if(analyser!=null) analyser.resize();

js/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ function BlackboxLogViewer() {
10961096
if(graph!=null) {
10971097
graph.refreshOptions(newSettings);
10981098
graph.initializeCraftModel();
1099-
invalidateGraph();
1099+
updateCanvasSize();
11001100
}
11011101

11021102
}),

0 commit comments

Comments
 (0)