fix image size error

This commit is contained in:
niuhuan 2021-12-13 08:15:22 +08:00
parent ceb5ba2051
commit 1a2a00e272
1 changed files with 14 additions and 5 deletions

View File

@ -3,7 +3,6 @@ import 'dart:io';
import 'package:another_xlider/another_xlider.dart'; import 'package:another_xlider/another_xlider.dart';
import 'package:event/event.dart'; import 'package:event/event.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
@ -956,11 +955,16 @@ class _WebToonReaderState extends _ImageReaderContentState {
_trueSizes[index]!.width, _trueSizes[index]!.width,
); );
} else { } else {
var maxHeight = constraints.maxHeight -
super._topBarHeight() -
(widget.struct.fullScreen
? super._topBarHeight()
: super._bottomBarHeight());
renderSize = Size( renderSize = Size(
constraints.maxHeight * maxHeight *
_trueSizes[index]!.width / _trueSizes[index]!.width /
_trueSizes[index]!.height, _trueSizes[index]!.height,
constraints.maxHeight, maxHeight,
); );
} }
} else { } else {
@ -1248,11 +1252,16 @@ class _ListViewReaderState extends _ImageReaderContentState
_trueSizes[index]!.width, _trueSizes[index]!.width,
); );
} else { } else {
var maxHeight = constraints.maxHeight -
super._topBarHeight() -
(widget.struct.fullScreen
? super._topBarHeight()
: super._bottomBarHeight());
renderSize = Size( renderSize = Size(
constraints.maxHeight * maxHeight *
_trueSizes[index]!.width / _trueSizes[index]!.width /
_trueSizes[index]!.height, _trueSizes[index]!.height,
constraints.maxHeight, maxHeight,
); );
} }
} else { } else {