Commit 4a591df2 by doszhang

Merge branch 'master' into release

parents b8f70c07 c8db4a73
...@@ -57,7 +57,7 @@ $(document).ready(function () { ...@@ -57,7 +57,7 @@ $(document).ready(function () {
}); });
} }
$('.container').css('height', document.documentElement.clientHeight + 'px'); $('.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'); $('.logo').css('top', fixHeight + 30 + 'px');
$("input").on("blur", function () { $("input").on("blur", function () {
window.scroll(0, 0); //失焦后强制让页面归位 window.scroll(0, 0); //失焦后强制让页面归位
...@@ -81,11 +81,16 @@ $(document).ready(function () { ...@@ -81,11 +81,16 @@ $(document).ready(function () {
$('.again,.saveTip').hide(); $('.again,.saveTip').hide();
$('.inputTip').show(); $('.inputTip').show();
$('.page').hide().filter('.page0').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 () { $('.make').on('click', function () {
if (!inited) { if (!inited) {
return; return;
} }
$('.usertips').hide();
var text = $.trim($('.page:visible').find('input[type=text]').val()); var text = $.trim($('.page:visible').find('input[type=text]').val());
if (text === '') { if (text === '') {
showTip('您还没有输入名字'); showTip('您还没有输入名字');
...@@ -167,6 +172,7 @@ $(document).ready(function () { ...@@ -167,6 +172,7 @@ $(document).ready(function () {
}) })
$('input[type=file]').on('change', function () { $('input[type=file]').on('change', function () {
$('.imgTip').find('canvas').show(); $('.imgTip').find('canvas').show();
$('.usertips').show();
imgInfo = { imgInfo = {
x: 0, x: 0,
y: 0, y: 0,
...@@ -205,16 +211,16 @@ $(document).ready(function () { ...@@ -205,16 +211,16 @@ $(document).ready(function () {
objectImg.crossOrigin = "Anonymous"; objectImg.crossOrigin = "Anonymous";
objectImg.setAttribute('crossOrigin', 'anonymous'); objectImg.setAttribute('crossOrigin', 'anonymous');
objectImg.onload = function () { objectImg.onload = function () {
var scale = 1, var scale = 1.3,
width = objectImg.width, width = objectImg.width * 2,
height = objectImg.height; height = objectImg.height * 2;
if (rotation === 90 || rotation === 270) { if (rotation === 90 || rotation === 270) {
width = objectImg.height; width = objectImg.height;
height = objectImg.width; height = objectImg.width;
} }
uploadedImg = document.createElement('CANVAS'); uploadedImg = document.createElement('CANVAS');
var uploadctx = uploadedImg.getContext('2d'); var uploadctx = uploadedImg.getContext('2d');
var scale = 1; var scale = 1.3;
if (width < height) { if (width < height) {
scale = 1000 / width; scale = 1000 / width;
} else { } else {
...@@ -349,8 +355,8 @@ mc.on('panstart panmove panend', function (event) { ...@@ -349,8 +355,8 @@ mc.on('panstart panmove panend', function (event) {
oldpoz.x = event.deltaX; oldpoz.x = event.deltaX;
oldpoz.y = event.deltaY; oldpoz.y = event.deltaY;
//console.log("movedX:" + movedX + ' movedY:' + movedY + 'event.deltaX:' + event.deltaX + ' event.deltaY:' + event.deltaY + "\r\n"); //console.log("movedX:" + movedX + ' movedY:' + movedY + 'event.deltaX:' + event.deltaX + ' event.deltaY:' + event.deltaY + "\r\n");
imgInfo.x += movedX; imgInfo.x += movedX * 4;
imgInfo.y += movedY; imgInfo.y += movedY * 4;
drawImage(); 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