Fix repeating pattern by y
This commit is contained in:
parent
45b5cedeb7
commit
65cef81086
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
import { indexOfAndSplice } from "../../helpers/array";
|
import { indexOfAndSplice } from "../../helpers/array";
|
||||||
import { renderImageFromUrlPromise } from "../../helpers/dom/renderImageFromUrl";
|
import { renderImageFromUrlPromise } from "../../helpers/dom/renderImageFromUrl";
|
||||||
|
import mediaSizes, { ScreenSize } from "../../helpers/mediaSizes";
|
||||||
import { deepEqual } from "../../helpers/object";
|
import { deepEqual } from "../../helpers/object";
|
||||||
|
|
||||||
type ChatBackgroundPatternRendererInitOptions = {
|
type ChatBackgroundPatternRendererInitOptions = {
|
||||||
@ -144,7 +145,9 @@ export default class ChatBackgroundPatternRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(let x = 0; x < canvas.width; x += imageWidth) {
|
for(let x = 0; x < canvas.width; x += imageWidth) {
|
||||||
context.drawImage(img, x, 0);
|
for(let y = 0; y < canvas.height; y += imageHeight) {
|
||||||
|
context.drawImage(img, x, y, imageWidth, imageHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// context.fillStyle = this.pattern;
|
// context.fillStyle = this.pattern;
|
||||||
// context.fillRect(0, 0, canvas.width, canvas.height);
|
// context.fillRect(0, 0, canvas.width, canvas.height);
|
||||||
@ -152,8 +155,9 @@ export default class ChatBackgroundPatternRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public setCanvasDimensions(canvas: HTMLCanvasElement) {
|
public setCanvasDimensions(canvas: HTMLCanvasElement) {
|
||||||
canvas.width = this.options.width * window.devicePixelRatio;
|
const devicePixelRatio = Math.min(2, window.devicePixelRatio);
|
||||||
canvas.height = this.options.height * window.devicePixelRatio * 1.5;
|
canvas.width = this.options.width * devicePixelRatio;
|
||||||
|
canvas.height = this.options.height * devicePixelRatio * (mediaSizes.activeScreen === ScreenSize.large ? 1.5 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public createCanvas() {
|
public createCanvas() {
|
||||||
|
@ -686,8 +686,11 @@ $background-transition-total-time: #{$input-transition-time - $background-transi
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
// mix-blend-mode: overlay;
|
// mix-blend-mode: overlay;
|
||||||
|
|
||||||
|
@include respond-to(medium-screens) {
|
||||||
height: 150%;
|
height: 150%;
|
||||||
top: -25%;
|
top: -25%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include animation-level(2) {
|
@include animation-level(2) {
|
||||||
|
Loading…
Reference in New Issue
Block a user