P5-1491: Fix for canvas frame gets fat after switching to inches
This commit is contained in:
@@ -80,18 +80,24 @@ function FrameHandler(viewport) {
|
||||
o.set(config.frames[frameType]);
|
||||
});
|
||||
|
||||
var vpData = viewport.getData();
|
||||
var frameSize = 29;
|
||||
if (vpData.dim.units === 'inch') {
|
||||
frameSize /= 2.54;
|
||||
}
|
||||
|
||||
_frames.top.height =
|
||||
_frames.bottom.height =
|
||||
_frames.right.width =
|
||||
_frames.left.width = viewport.getData().ppmm * 29 * viewport.canvas.getImage().scaleX;
|
||||
_frames.left.width = vpData.ppmm * frameSize * viewport.canvas.getImage().scaleX;
|
||||
|
||||
_frames.top.width = _frames.bottom.width = viewport.getData().width;
|
||||
_frames.right.height = _frames.left.height = viewport.getData().height;
|
||||
_frames.top.width = _frames.bottom.width = vpData.width;
|
||||
_frames.right.height = _frames.left.height = vpData.height;
|
||||
|
||||
if (frameType === 'image') {
|
||||
_frames.top.width -= (viewport.getData().ppmm * 29 * viewport.canvas.getImage().scaleX) * 2;
|
||||
_frames.top.width -= (vpData.ppmm * frameSize * viewport.canvas.getImage().scaleX) * 2;
|
||||
_frames.bottom.width = _frames.top.width;
|
||||
_frames.right.height -= (viewport.getData().ppmm * 29 * viewport.canvas.getImage().scaleX) * 2;
|
||||
_frames.right.height -= (vpData.ppmm * frameSize * viewport.canvas.getImage().scaleX) * 2;
|
||||
_frames.left.height = _frames.right.height;
|
||||
|
||||
_frames.top.set({
|
||||
|
||||
Reference in New Issue
Block a user