Skip to content

Commit

Permalink
Changed canvas size, prevented timer clock from being selected while …
Browse files Browse the repository at this point in the history
…dragging pieces
  • Loading branch information
Jeeejeets committed Apr 25, 2018
1 parent e8e28eb commit 9acbd12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
body{
position: relative;
height: 98vh;
height: 90vh;
background-color: #333;
z-index: -10;
padding: 0 10px;
Expand All @@ -27,6 +27,7 @@
text-align: center;
color: white;
font-weight: bold;
user-select: none;
}
</style>
<script type="text/javascript" src="script.js">
Expand Down
6 changes: 3 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ function setCanvas() {
canvas = document.getElementById('ukladanka');
stage = canvas.getContext('2d');
var parentHeight = canvas.parentElement.clientHeight;
var parentWidth = window.getComputedStyle(canvas.parentElement);
var parentPadding = parseFloat(parentWidth.paddingLeft) + parseFloat(parentWidth.paddingRight);
parentWidth = canvas.parentElement.clientWidth - parentPadding;
var parentStyle = window.getComputedStyle(canvas.parentElement);
var parentPaddingX = parseFloat(parentStyle.paddingLeft) + parseFloat(parentStyle.paddingRight);
parentWidth = canvas.parentElement.clientWidth - parentPaddingX;
canvas.width = parentWidth;
canvas.height = parentHeight;
canvas.style.border = "1px solid black";
Expand Down

0 comments on commit 9acbd12

Please sign in to comment.