mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/posts: add post view (without comments yet)
This commit is contained in:
@ -44,12 +44,25 @@ class PostContentControl {
|
||||
this._currentFitFunction = this.fitBoth;
|
||||
let mul = this._post.canvasHeight / this._post.canvasWidth;
|
||||
if (this._viewportWidth * mul < this._viewportHeight) {
|
||||
this.fitWidth();
|
||||
let width = this._viewportWidth;
|
||||
if (!settings.getSettings().upscaleSmallPosts) {
|
||||
width = Math.min(this._post.canvasWidth, width);
|
||||
}
|
||||
this._resize(width, width * mul);
|
||||
} else {
|
||||
this.fitHeight();
|
||||
let height = this._viewportHeight;
|
||||
if (!settings.getSettings().upscaleSmallPosts) {
|
||||
height = Math.min(this._post.canvasHeight, height);
|
||||
}
|
||||
this._resize(height / mul, height);
|
||||
}
|
||||
}
|
||||
|
||||
fitOriginal() {
|
||||
this._currentFitFunction = this.fitOriginal;
|
||||
this._resize(this._post.canvasWidth, this._post.canvasHeight);
|
||||
}
|
||||
|
||||
get _viewportWidth() {
|
||||
return this._viewportSizeCalculator()[0];
|
||||
}
|
||||
|
Reference in New Issue
Block a user