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

Fix cover image resizing on Chrome browser #349

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
16 changes: 14 additions & 2 deletions js/views/reflowable_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,8 @@ var ReflowableView = function(options, reader){
redraw();

_.defer(function () {
resizeImages();


if (_lastPageRequest == undefined) {
self.saveCurrentPosition();
Expand Down Expand Up @@ -926,8 +928,18 @@ var ReflowableView = function(options, reader){
// if we set max-width/max-height to 100% columnizing engine chops images embedded in the text
// (but not if we set it to 99-98%) go figure.
// TODO: CSS min-w/h is content-box, not border-box (does not take into account padding + border)? => images may still overrun?
$elem.css('max-width', '98%');
$elem.css('max-height', '98%');
$elem.css('max-width', _$epubHtml.css("width"));
$elem.css('max-height', _$epubHtml.css("height"));

if ($elem.attr('height') == '100%')
$elem.css('height', _$epubHtml.css("height"));
else if (!$elem.css('height')) {
$elem.css('height', 'auto');
}

if (!$elem.css('width')) {
$elem.css('width', 'auto');
}

if(!$elem.css('height')) {
$elem.css('height', 'auto');
Expand Down