pencil
pencil copied to clipboard
window starts taller than screen on win 7
The first time I started the program it was taller than my screen. I could not see the menu bar or title bar. Fortunately, I use a window re-sizing / re-positioning autohotkey script... ;-]
1920x1080 resolution on win 7 pro
:four_leaf_clover:
I can reproduce this on Windows 10, same resolution.
I found these, but don't have enough experience with the code.
mainWindow.js
Pencil.getBestFitSize = function () {
var mainViewPanel = document.getElementById("mainViewPanel");
var zoom = Pencil.activeCanvas ? (1 / Pencil.activeCanvas.zoom) : 1;
return [zoom * (mainViewPanel.boxObject.width - Pencil._getCanvasPadding()), zoom * (mainViewPanel.boxObject.height - Pencil._getCanvasPadding())].join("x");
};
Pencil.getBestFitSizeObject = function () {
var mainViewPanel = document.getElementById("mainViewPanel");
var zoom = Pencil.activeCanvas ? (1 / Pencil.activeCanvas.zoom) : 1;
return {width: zoom * (mainViewPanel.boxObject.width - Pencil._getCanvasPadding()), height: zoom * (mainViewPanel.boxObject.height - Pencil._getCanvasPadding())};
};
controller.js
Controller.prototype.sizeToBestFit = function (passedPage) {
var page = passedPage ? passedPage : this.getCurrentPage();
var canvas = page._view.canvas;
if (!canvas) return;
var newSize = Pencil.getBestFitSizeObject();
if (newSize) {
canvas.setSize(newSize.width, newSize.height);
page.properties.width = newSize.width;
page.properties.height = newSize.height;
Config.set("lastSize", [newSize.width, newSize.height].join("x"));
}
};