Skip to content

Commit

Permalink
added Reader parameter to enable OSX launcher to specify that it need…
Browse files Browse the repository at this point in the history
…s a workaround for the fixed layout scaled rendering (CSS transform), see readium/SDKLauncher-OSX#21
  • Loading branch information
danielweck committed Oct 22, 2014
1 parent 152f961 commit ca4e1d0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
21 changes: 16 additions & 5 deletions js/views/one_page_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,23 @@ ReadiumSDK.Views.OnePageView = function(options, classes, enableBookStyleOverrid
enable3D = true;
}

var css = ReadiumSDK.Helpers.CSSTransformString({scale : scale, enable3D: enable3D});
if (reader.needsFixedLayoutScalerWorkAround())
{
var css1 = ReadiumSDK.Helpers.CSSTransformString({scale : scale, enable3D: enable3D});
_$epubHtml.css(css1);

css["width"] = _meta_size.width;
css["height"] = _meta_size.height;

_$scaler.css(css);
var css2 = ReadiumSDK.Helpers.CSSTransformString({scale : 1, enable3D: enable3D});
css2["width"] = _meta_size.width;
css2["height"] = _meta_size.height;
_$scaler.css(css2);
}
else
{
var css = ReadiumSDK.Helpers.CSSTransformString({scale : scale, enable3D: enable3D});
css["width"] = _meta_size.width;
css["height"] = _meta_size.height;
_$scaler.css(css);
}

// Chrome workaround: otherwise text is sometimes invisible (probably a rendering glitch due to the 3D transform graphics backend?)
//_$epubHtml.css("visibility", "hidden"); // "flashing" in two-page spread mode is annoying :(
Expand Down
5 changes: 4 additions & 1 deletion js/views/reader_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@ ReadiumSDK.Views.ReaderView = function(options) {
console.log("** EL is a string:" + _$el.attr('id'));
}


if(options.iframeLoader) {
_iframeLoader = options.iframeLoader;
}
else {
_iframeLoader = new ReadiumSDK.Views.IFrameLoader({ mathJaxUrl: options.mathJaxUrl});
}


_needsFixedLayoutScalerWorkAround = options.needsFixedLayoutScalerWorkAround;
this.needsFixedLayoutScalerWorkAround = function() { return _needsFixedLayoutScalerWorkAround; }

this.createViewForType = function(viewType, options) {
var createdView;
switch(viewType) {
Expand Down

0 comments on commit ca4e1d0

Please sign in to comment.