This commit is contained in:
Mahdi Dibaiee 2014-02-06 16:30:58 +03:30
parent 3f17f819d4
commit 548de846f8
3 changed files with 10 additions and 6 deletions

View File

@ -128,7 +128,7 @@ header {
height: 100%; height: 100%;
width: 15rem; width: 15rem;
background: #262626; background: #262626;
display: block; display: table;
position: absolute; position: absolute;
left: -15rem; left: -15rem;
top: 5rem; top: 5rem;
@ -136,6 +136,8 @@ header {
font-family: 'MozTT-Light'; font-family: 'MozTT-Light';
font-size: 8pt; font-size: 8pt;
transition: left 0.2s ease-out; transition: left 0.2s ease-out;
border-collapse: collapse;
overflow: hidden;
&.pulled { &.pulled {
left: 0; left: 0;
@ -214,8 +216,8 @@ header {
margin-top: 1rem; margin-top: 1rem;
} }
.bottom { .bottom {
position: absolute; display: table-row;
bottom: 5rem; vertical-align: bottom;
button { button {
margin-left: 3.5rem; margin-left: 3.5rem;
} }

View File

@ -60,7 +60,7 @@ function undo() {
window.points.history = history; window.points.history = history;
window.points.history.last = history.last-1; window.points.history.last = history.last-1;
} else { } else {
c.clearRect(0,0, $c.width(), $c.height()); c.clearRect(0,0, width(), height());
window.points = []; window.points = [];
window.points.history = history; window.points.history = history;
window.points.history.last = 0; window.points.history.last = 0;
@ -80,11 +80,11 @@ function redo() {
} }
function width() { function width() {
return $c.width() * window.devicePixelRatio; return +$c.attr('width');
} }
function height() { function height() {
return ($c.height() - 53) * window.devicePixelRatio; return +$c.attr('height');
} }
function dataToBlob(data) { function dataToBlob(data) {

View File

@ -174,7 +174,9 @@ function save() {
$('#clear').on('tap', function() { $('#clear').on('tap', function() {
c.clearRect(0, 0, width(), height()); c.clearRect(0, 0, width(), height());
var h = window.points.history;
window.points = []; window.points = [];
window.points.history = h;
if(window.points.history.last < window.points.history.length-1) { if(window.points.history.last < window.points.history.length-1) {
window.points.history.splice(window.points.history.last+1); window.points.history.splice(window.points.history.last+1);
} }