Skip to content

Commit

Permalink
Update compiled files
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Jul 16, 2017
1 parent dd4f6a3 commit e4c6cbd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
5 changes: 4 additions & 1 deletion build/Outline.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,5 +406,8 @@ Outline.propTypes = {
onLoadSuccess: _propTypes2.default.func,
onParseError: _propTypes2.default.func,
onParseSuccess: _propTypes2.default.func,
pdf: _propTypes2.default.object
pdf: _propTypes2.default.shape({
getDestination: _propTypes2.default.func.isRequired,
getOutline: _propTypes2.default.func.isRequired
})
};
5 changes: 4 additions & 1 deletion build/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ Page.propTypes = {
// @TODO: Check if > 0, < pdf.numPages
pageIndex: _propTypes2.default.number,
pageNumber: _propTypes2.default.number,
pdf: _propTypes2.default.object,
pdf: _propTypes2.default.shape({
getPage: _propTypes2.default.func.isRequired,
numPages: _propTypes2.default.number.isRequired
}),
rotate: _propTypes2.default.number,
scale: _propTypes2.default.number,
width: _propTypes2.default.number
Expand Down
9 changes: 8 additions & 1 deletion build/PageCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ var PageCanvas = function (_Component) {

return _react2.default.createElement('canvas', {
className: 'ReactPDF__Page__canvas',
style: {
display: 'block',
userSelect: 'none'
},
ref: function ref(_ref2) {
if (!_ref2) return;

Expand Down Expand Up @@ -146,7 +150,10 @@ exports.default = PageCanvas;
PageCanvas.propTypes = {
onRenderError: _propTypes2.default.func,
onRenderSuccess: _propTypes2.default.func,
page: _propTypes2.default.object,
page: _propTypes2.default.shape({
getViewport: _propTypes2.default.func.isRequired,
render: _propTypes2.default.func.isRequired
}).isRequired,
rotate: _propTypes2.default.number,
scale: _propTypes2.default.number
};
27 changes: 17 additions & 10 deletions build/PageTextContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var PageTextContent = function (_Component) {

var scale = _this.props.scale;
var _this2 = _this,
viewport = _this2.viewport;
viewport = _this2.unrotatedViewport;

var top = viewport.height / scale - bottom - textItem.height;

Expand Down Expand Up @@ -149,32 +149,36 @@ var PageTextContent = function (_Component) {
}, {
key: 'render',
value: function render() {
var rotate = this.props.rotate;
var viewport = this.unrotatedViewport;


return _react2.default.createElement(
'div',
{
className: 'ReactPDF__Page__textContent',
style: {
position: 'absolute',
top: 0,
right: 0,
bottom: 0,
left: 0,
color: 'transparent'
top: '50%',
left: '50%',
width: viewport.width + 'px',
height: viewport.height + 'px',
color: 'transparent',
transform: 'translate(-50%, -50%) rotate(' + rotate + 'deg)'
}
},
this.renderTextItems()
);
}
}, {
key: 'viewport',
key: 'unrotatedViewport',
get: function get() {
var _props = this.props,
page = _props.page,
rotate = _props.rotate,
scale = _props.scale;


return page.getViewport(scale, rotate);
return page.getViewport(scale);
}
}]);

Expand All @@ -187,7 +191,10 @@ exports.default = PageTextContent;
PageTextContent.propTypes = {
onGetTextError: _propTypes2.default.func,
onGetTextSuccess: _propTypes2.default.func,
page: _propTypes2.default.object,
page: _propTypes2.default.shape({
getTextContent: _propTypes2.default.func.isRequired,
getViewport: _propTypes2.default.func.isRequired
}).isRequired,
rotate: _propTypes2.default.number,
scale: _propTypes2.default.number
};

0 comments on commit e4c6cbd

Please sign in to comment.