Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show chequerboard only if there is transparency and during cropping too #3174

Merged
merged 6 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion kahuna/public/js/directives/ui-crop-box/cropper-override.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,35 @@
}

.easel .cropper-canvas {
background-color: #000;
background-color: #bdbdbd;
background-image:
linear-gradient(45deg, white 25%, transparent 25%),
linear-gradient(135deg, white 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, white 75%),
linear-gradient(135deg, transparent 75%, white 75%);

background-size: 20px 20px;

background-position: 0 0, 10px 0, 10px -10px, 0px 10px;
opacity: .5;
}

.easel .cropper-view-box :first-child {
display: block;
height: 100%;
outline: 1px solid #39f;
outline-color: rgba(51, 153, 255, 0.75);
overflow: hidden;
width: 100%;
background-color: #bdbdbd;
background-image:
linear-gradient(45deg, white 25%, transparent 25%),
linear-gradient(135deg, white 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, white 75%),
linear-gradient(135deg, transparent 75%, white 75%);

background-size: 20px 20px;

background-position: 0 0, 10px 0, 10px -10px, 0px 10px;
}

2 changes: 1 addition & 1 deletion kahuna/public/js/image/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
ng-if="!ctrl.crop"
draggable="true"
ui-drag-data="ctrl.image | asImageDragData">
<img class="easel__image easel__image--checkered__background"
<img ng-class="{'easel__image':true,'easel__image--checkered__background': ctrl.image.data.optimisedPng }"
alt="preview of original image"
ng-src="{{:: ctrl.optimisedImageUri}}"
grid:track-image="ctrl.image"
Expand Down