Skip to content

Commit

Permalink
Scrolling issue fixed. Matrix handler old values.
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-kas committed Apr 29, 2013
1 parent 9315b63 commit d0c58e4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
10 changes: 5 additions & 5 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ html, body {

#viewer {
width: 100%;
height: 100%;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
Expand All @@ -49,7 +50,6 @@ html, body {
}
#viewerScreen {
display: table;
/*height: 100%;*/
}
.viewerRows .viewerCells {
border-bottom: 1px solid #ddd;
Expand All @@ -70,12 +70,11 @@ html, body {
position: relative;
}
#viewerScreen .viewerCellContent {
display: block;
/*display: block;*/
}
canvas {
cursor: crosshair !important;
/*display: block;*/
margin: auto;
cursor: default;
display: block;
}

/*Patient infos*/
Expand Down Expand Up @@ -159,6 +158,7 @@ canvas {
overflow-y: scroll;
overflow-x: hidden;
width: 300px;
height: 100%;
border-right: 1px solid #ccc;
}
.input-append.customfile {
Expand Down
22 changes: 12 additions & 10 deletions js/DcmViewer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

function DcmViewer() {
this.toolbox = new Toolbox(this.painter);
this.scrollIndex = 0;
Expand Down Expand Up @@ -102,10 +101,9 @@ DcmViewer.prototype.matrixHandler = function(e) {
var rows = e.split(',')[0];
var columns = e.split(',')[1];
var width = parseInt($('#viewer').width());
var height = parseInt($('#viewer').height()) - 72;
var height = parseInt($('#viewer').height()) - 72 - (rows * 0.5); // 72px toolbar, 0.5px for the border
var cellWidth = width / columns;
var cellHeight = height / rows;

var cellHeight = (height / rows);
$('#viewerScreen').empty();
var newPainters = [];

Expand All @@ -117,12 +115,12 @@ DcmViewer.prototype.matrixHandler = function(e) {
//var newSize = Math.min(cellWidth, cellHeight);
var tmpId = '#' + rowName + ' #column' + x;
var newId = 'canvas' + x + '' + y;
var newId2 = 'content' + x + '' + y;
$(tmpId).append('<div id="' + newId2 + '" class="viewerCellContent" style="display:block;"></div>');

$('#' + newId2).append('<canvas id="' + newId + '" width="' + cellWidth + '" height="' + cellHeight + '">Your browser does not support HTML5 canvas</canvas>');
$('#' + newId2).append('<div class="studyInfo"></div>');
$('#' + newId2).append('<div class="patientInfo"></div>');
// var newId2 = 'content' + x + '' + y;
// $(tmpId).append('<div id="' + newId2 + '" class="viewerCellContent"></div>');
// '#' + newId2
$(tmpId).append('<canvas id="' + newId + '" width="' + cellWidth + 'px" height="' + cellHeight + 'px">Your browser does not support HTML5 canvas</canvas>');
$(tmpId).append('<div class="studyInfo"></div>');
$(tmpId).append('<div class="patientInfo"></div>');

var tmpPainter = new CanvasPainter(newId);
newPainters.push(tmpPainter);
Expand All @@ -131,6 +129,10 @@ DcmViewer.prototype.matrixHandler = function(e) {
var index = (this.scrollIndex + x + y) % this.numFiles;
tmpPainter.setSeries(this.painters[0].series);
tmpPainter.currentFile = tmpPainter.series[index];
// set old values to the new painters
tmpPainter.setWindowing(this.painters[0].getWindowing()[0], this.painters[0].getWindowing()[1]);
tmpPainter.setScale(this.painters[0].getScale());
tmpPainter.setPan(this.painters[0].getPan()[0], this.painters[0].getPan()[1]);
tmpPainter.drawImg();
updateInfo(tmpPainter, getSelector(tmpPainter));
}
Expand Down
2 changes: 1 addition & 1 deletion js/tools/Roi.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Roi.prototype.mouseup = function(x, y, painters, target) {
var painter = getPainterFromId(target.id, painters);
var context = painter.context;
var dist = calculateDist(painter, this.startX, this.startY, x, y);
context.font = "10px Helvetica";
context.font = ".8em Helvetica";
context.fillStyle = this.lineColor;
context.fillText(dist, x + 3, y + 3);
this.started = false;
Expand Down

0 comments on commit d0c58e4

Please sign in to comment.