Commit e5b0e731 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

reset image dimensions after edition

parent 887cdaa4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
{
  "name": "@pdn-certic/vue-jama",
  "version": "0.8.3",
  "version": "0.8.4",
  "scripts": {
    "serve": "rimraf -rf ./node_modules/.cache/vue-loader && vue-cli-service serve",
    "build": "vue-cli-service build",
+12 −2
Original line number Diff line number Diff line
@@ -327,9 +327,15 @@ export default {

    computed: {
        scale() {
          if(!this.imageDimensions) {
            this.fetchImage();
            return 1;
          }
          else {
            const wRatio = this.maxWidth / this.imageDimensions.width;
            const hRatio = this.maxHeight / this.imageDimensions.height;
            return Math.min(wRatio, hRatio, 1)
          }
        },

        rotationScale() {
@@ -422,14 +428,17 @@ export default {
        this.fetchImage();
    },


    updated() {
        //this.fetchImage();
      if(!this.imageDimensions)
        this.fetchImage();
    },

    methods: {

        updateRotatedImageDimension() {

            if(!this.imageDimensions)
              return;
            let r = Math.abs(this.rotation);

            if (r >= 180)
@@ -653,6 +662,7 @@ export default {
            this.cropTop = 0;
            this.cropLeft = 0;
            this.rotation = 0;
            this.imageDimensions = null;
        },

        resetZoom() {