Skip to content

Commit

Permalink
Merge pull request #59 from SamurAI-Coding/viewer/fix_view_for_narrow
Browse files Browse the repository at this point in the history
[viewer] fix view for narrow
  • Loading branch information
arukuka authored Jan 5, 2018
2 parents cc0f83f + 80873ef commit cbea7a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions viewer/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,11 @@ function drawCourse() {
var overviewWidth = overviewPitch*(course.width+1);
// The rest of the space is used by the magnified display
fieldWidth = svgWidth-overviewWidth-2*xmargin;
mag = fieldWidth/course.width;
mag = Math.min(64, Math.min(fieldWidth/course.width, svgHeight/11));
field = document.createElementNS(ns, 'svg');
field.setAttribute('height', svgHeight);
field.setAttribute('width', fieldWidth);
field.setAttribute('x', 0);
field.setAttribute('x', Math.max(0, (fieldWidth - (course.width + 1) * mag) / 2 ));
field.setAttribute('y', 0);
// Draw the course on an SVG group "courseFig"
gridDotRadius = mag*gridDotRadiusRatio;
Expand Down

0 comments on commit cbea7a6

Please sign in to comment.