Skip to content

Commit 4874255

Browse files
authored
Merge pull request #106 from ibrahemomari/design-thumbnail
fix big croped image size
2 parents f53f6ea + 4742d22 commit 4874255

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

control/design/index.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
<style>
2121
.thumbnail-border {
2222
border: 2px solid rgba(0, 0, 0, 0.4);
23+
width: 100%;
24+
height: 100%;
2325
}
2426
</style>
2527

@@ -74,7 +76,7 @@
7476
<div class="screen mostdevices pull-left text-center">
7577
<a class="border-radius-three default-background-hover" ng-click="changeBackground('i3x2')">
7678
<span ng-hide="data.design.backgroundImage.i3x2" class="add-icon">+</span>
77-
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i3x2" ng-src="{{cropImage(data.design.backgroundImage.i3x2, 640,960)}}">
79+
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i3x2" ng-src="{{cropImage(data.design.backgroundImage.i3x2, 640,960, 5)}}">
7880
</a>
7981
<label>3:2</label>
8082
<label class="secondary">640x960</label>
@@ -84,7 +86,7 @@
8486
<div class="screen iphone pull-left text-center">
8587
<a class="border-radius-three default-background-hover" ng-click="changeBackground('i16x9')">
8688
<span ng-hide="data.design.backgroundImage.i16x9" class="add-icon">+</span>
87-
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i16x9" ng-src="{{cropImage(data.design.backgroundImage.i16x9, 1242, 2208)}}">
89+
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i16x9" ng-src="{{cropImage(data.design.backgroundImage.i16x9, 1242, 2208 , 20)}}">
8890
</a>
8991
<label>16:9</label>
9092
<label class="secondary">1242x2208</label>
@@ -95,7 +97,7 @@
9597
<div class="screen ipads pull-left text-center">
9698
<a class="border-radius-three default-background-hover" ng-click="changeBackground('i4x3')">
9799
<span ng-hide="data.design.backgroundImage.i4x3" class="add-icon">+</span>
98-
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i4x3" ng-src="{{cropImage(data.design.backgroundImage.i4x3, 1536, 2048)}}">
100+
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i4x3" ng-src="{{cropImage(data.design.backgroundImage.i4x3, 1536, 2048, 20)}}">
99101
</a>
100102
<label>4:3</label>
101103
<label class="secondary">1536x2048</label>
@@ -105,7 +107,7 @@
105107
<div class="screen tablets pull-left text-center">
106108
<a class="border-radius-three default-background-hover" ng-click="changeBackground('i16x10')">
107109
<span ng-hide="data.design.backgroundImage.i16x10" class="add-icon">+</span>
108-
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i16x10" ng-src="{{cropImage(data.design.backgroundImage.i16x10, 1600, 2560)}}">
110+
<img class="thumbnail-border" ng-show="data.design.backgroundImage.i16x10" ng-src="{{cropImage(data.design.backgroundImage.i16x10, 1600, 2560, 20)}}">
109111
</a>
110112
<label>16:10</label>
111113
<label class="secondary">1600x2560</label>
@@ -366,14 +368,14 @@
366368
}
367369
};
368370

369-
$scope.cropImage = function (url, width, height) {
371+
$scope.cropImage = function (url, width, height, dividedBy) {
370372
if (!url) {
371373
return "";
372374
}
373375
else {
374376
let croppedImage = buildfire.imageLib.cropImage(
375377
url,
376-
{ width, height });
378+
{ width: width / dividedBy, height: height / dividedBy });
377379
return croppedImage
378380
}
379381
};

0 commit comments

Comments
 (0)