# HG changeset patch # User duong tam kien # Date 1487945168 -3600 # Node ID a0ae89d96c27d0dcdfec27b476a2ee3792fe156d # Parent 3d48f9520c8d2570256ba917ef9082cd61eda38d# Parent 8551c5f9189e81afbac9dace8f4c134cabfe3685 adds contact email as a setting variable from the app (instead of raw in the template diff -r 3d48f9520c8d -r a0ae89d96c27 .hgtags --- a/.hgtags Fri Feb 24 15:04:22 2017 +0100 +++ b/.hgtags Fri Feb 24 15:06:08 2017 +0100 @@ -37,3 +37,11 @@ 392cabcac2d3e055cff043e6669dc6682962b31f 0.0.20 97d0bb077be7761540b339b6bdf34b0a5daffdf1 0.0.20 5f4c9c193a781b9ab1ce395a2f4277ef2696542a 0.0.21 +5f4c9c193a781b9ab1ce395a2f4277ef2696542a 0.0.21 +e1762995780bf42564c9928cd8522e6effe36ed8 0.0.21 +e1762995780bf42564c9928cd8522e6effe36ed8 0.0.21 +fa0393f81302e3acc135e7b1899bb93836034fcc 0.0.21 +fa0393f81302e3acc135e7b1899bb93836034fcc 0.0.21 +d53a2e7f3c3223dc8e259d98fdce2d1d72374cf7 0.0.21 +d53a2e7f3c3223dc8e259d98fdce2d1d72374cf7 0.0.21 +a9b3d3bb27af5367056ebe16ee24f63ec8f22579 0.0.21 diff -r 3d48f9520c8d -r a0ae89d96c27 src/setup.py --- a/src/setup.py Fri Feb 24 15:04:22 2017 +0100 +++ b/src/setup.py Fri Feb 24 15:06:08 2017 +0100 @@ -109,7 +109,7 @@ url='http://www.iri.centrepompidou.fr/dev/hg/iconolab', license='LICENSE', description='projet Iconolab', - long_description=open('README.md').read(), + long_description="Projet Iconolab", classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', diff -r 3d48f9520c8d -r a0ae89d96c27 src_js/iconolab-bundle/src/components/editor/Canvas.vue --- a/src_js/iconolab-bundle/src/components/editor/Canvas.vue Fri Feb 24 15:04:22 2017 +0100 +++ b/src_js/iconolab-bundle/src/components/editor/Canvas.vue Fri Feb 24 15:06:08 2017 +0100 @@ -123,6 +123,28 @@ loaded: function(loaded) { if (!loaded) { return; } + var bcr = this.paper.node.getBoundingClientRect(); + + console.log('Viewport: %s x %s', bcr.width, bcr.height); + + var viewBox = [0 , 0, this.imageWidth, this.imageHeight]; + var viewport = { + width: bcr.width, + height: bcr.height + }; + + Object.assign(this, { + viewBox: viewBox, + viewport: viewport, + }); + + var handlerSize = 15 * Math.min(viewBox[2], viewBox[3]) / viewport.width; + + this.$refs.rect.handlerSize = handlerSize; + this.$refs.free.handlerRadius = handlerSize / 2; + + this.paper.attr({"viewBox": this.viewBox}); + if (this.annotation) { this.loadAnnotation(); } else { @@ -178,37 +200,11 @@ console.log('Image: %s x %s', img.width, img.height); - // FIXME - // Image is actually NOT loaded at this step - setTimeout(() => { - - var bcr = this.paper.node.getBoundingClientRect(); - - console.log('Viewport: %s x %s', bcr.width, bcr.height); - - var viewBox = [0 , 0, img.width, img.height]; - var viewport = { - width: bcr.width, - height: bcr.height - }; - - Object.assign(this, { - imageWidth: img.width, - imageHeight: img.height, - viewBox: viewBox, - viewport: viewport, - }); - - var handlerSize = 15 * Math.min(viewBox[2], viewBox[3]) / viewport.width; - - this.$refs.rect.handlerSize = handlerSize; - this.$refs.free.handlerRadius = handlerSize / 2; - - this.paper.attr({"viewBox": this.viewBox}); - - this.loaded = true; - - }, 100); + Object.assign(this, { + imageWidth: img.width, + imageHeight: img.height, + loaded: true + }); } img.src = this.image;