Commit 4a591df2 by doszhang

Merge branch 'master' into release

parents b8f70c07 c8db4a73
......@@ -57,7 +57,7 @@ $(document).ready(function () {
});
}
$('.container').css('height', document.documentElement.clientHeight + 'px');
var fixHeight = ($('.page').height() - document.documentElement.clientHeight) / 2;
var fixHeight = Math.abs($('.page').height() - document.documentElement.clientHeight) / 2;
$('.logo').css('top', fixHeight + 30 + 'px');
$("input").on("blur", function () {
window.scroll(0, 0); //失焦后强制让页面归位
......@@ -81,11 +81,16 @@ $(document).ready(function () {
$('.again,.saveTip').hide();
$('.inputTip').show();
$('.page').hide().filter('.page0').show();
ctx.save();
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = "#ffffff";
ctx.fillRect(0, 0, canvas.width, canvas.height);
})
$('.make').on('click', function () {
if (!inited) {
return;
}
$('.usertips').hide();
var text = $.trim($('.page:visible').find('input[type=text]').val());
if (text === '') {
showTip('您还没有输入名字');
......@@ -167,6 +172,7 @@ $(document).ready(function () {
})
$('input[type=file]').on('change', function () {
$('.imgTip').find('canvas').show();
$('.usertips').show();
imgInfo = {
x: 0,
y: 0,
......@@ -205,16 +211,16 @@ $(document).ready(function () {
objectImg.crossOrigin = "Anonymous";
objectImg.setAttribute('crossOrigin', 'anonymous');
objectImg.onload = function () {
var scale = 1,
width = objectImg.width,
height = objectImg.height;
var scale = 1.3,
width = objectImg.width * 2,
height = objectImg.height * 2;
if (rotation === 90 || rotation === 270) {
width = objectImg.height;
height = objectImg.width;
}
uploadedImg = document.createElement('CANVAS');
var uploadctx = uploadedImg.getContext('2d');
var scale = 1;
var scale = 1.3;
if (width < height) {
scale = 1000 / width;
} else {
......@@ -349,8 +355,8 @@ mc.on('panstart panmove panend', function (event) {
oldpoz.x = event.deltaX;
oldpoz.y = event.deltaY;
//console.log("movedX:" + movedX + ' movedY:' + movedY + 'event.deltaX:' + event.deltaX + ' event.deltaY:' + event.deltaY + "\r\n");
imgInfo.x += movedX;
imgInfo.y += movedY;
imgInfo.x += movedX * 4;
imgInfo.y += movedY * 4;
drawImage();
}
//苹果手机自动调整图片 不需要旋转
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment