Mercurial > hg > orthanc-stone
comparison Applications/StoneWebViewer/WebApplication/print.js @ 1657:66e5fcdf5597
pdf viewer is working
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 18 Nov 2020 11:19:09 +0100 |
parents | 39137da83b0b |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1656:4cdc297be5a6 | 1657:66e5fcdf5597 |
---|---|
34 } | 34 } |
35 | 35 |
36 // https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html | 36 // https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html |
37 var realToCSSPixels = window.devicePixelRatio; | 37 var realToCSSPixels = window.devicePixelRatio; |
38 | 38 |
39 $('#viewport canvas').each(function(key, canvas) { | 39 $('.viewport-canvas').each(function(key, canvas) { |
40 if ($(canvas).is(':visible')) { | 40 if ($(canvas).is(':visible')) { |
41 $(canvas).width(Math.floor(realToCSSPixels * $(canvas).get(0).clientWidth)); | 41 $(canvas).width(Math.floor(realToCSSPixels * $(canvas).get(0).clientWidth)); |
42 $(canvas).height(Math.floor(realToCSSPixels * $(canvas).get(0).clientHeight)); | 42 $(canvas).height(Math.floor(realToCSSPixels * $(canvas).get(0).clientHeight)); |
43 } | 43 } |
44 }); | 44 }); |
50 function afterPrint() { | 50 function afterPrint() { |
51 var body = $('body'); | 51 var body = $('body'); |
52 body.removeClass('print'); | 52 body.removeClass('print'); |
53 body.css('width', '100%'); | 53 body.css('width', '100%'); |
54 body.css('height', '100%'); | 54 body.css('height', '100%'); |
55 $('#viewport canvas').css('width', '100%'); | 55 $('.viewport-canvas').css('width', '100%'); |
56 $('#viewport canvas').css('height', '100%'); | 56 $('.viewport-canvas').css('height', '100%'); |
57 | 57 |
58 stone.FitForPrint(); | 58 stone.FitForPrint(); |
59 } | 59 } |
60 | 60 |
61 | 61 |