|
@@ -140,26 +140,9 @@ export default class Resizer {
|
|
|
updateSize( domEventData, editor ) {
|
|
updateSize( domEventData, editor ) {
|
|
|
const newSize = this._proposeNewSize( domEventData );
|
|
const newSize = this._proposeNewSize( domEventData );
|
|
|
|
|
|
|
|
- // editor.editing.view.change( writer => {
|
|
|
|
|
- // const domResizeHost = this._getResizeHost();
|
|
|
|
|
- // const unit = this._options.unit;
|
|
|
|
|
-
|
|
|
|
|
- // const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + this._options.unit;
|
|
|
|
|
-
|
|
|
|
|
- // newSize.width = parseInt( newWidth );
|
|
|
|
|
- // newSize.height = 20;
|
|
|
|
|
- // newSize.handleHostWidth = parseInt( newWidth );
|
|
|
|
|
- // newSize.handleHostHeight = 20;
|
|
|
|
|
-
|
|
|
|
|
- // writer.setStyle( 'width', newWidth, this._options.viewElement );
|
|
|
|
|
-
|
|
|
|
|
- // this.state.update( newSize );
|
|
|
|
|
- // } );
|
|
|
|
|
-
|
|
|
|
|
editor.editing.view.change( writer => {
|
|
editor.editing.view.change( writer => {
|
|
|
const unit = this._options.unit;
|
|
const unit = this._options.unit;
|
|
|
-
|
|
|
|
|
- const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + this._options.unit;
|
|
|
|
|
|
|
+ const newWidth = ( unit === '%' ? newSize.widthPercents : newSize.width ) + unit;
|
|
|
|
|
|
|
|
writer.setStyle( 'width', newWidth, this._options.viewElement );
|
|
writer.setStyle( 'width', newWidth, this._options.viewElement );
|
|
|
} );
|
|
} );
|
|
@@ -181,8 +164,6 @@ export default class Resizer {
|
|
|
newSize.width = Math.round( domResizeHostRect.width );
|
|
newSize.width = Math.round( domResizeHostRect.width );
|
|
|
newSize.height = Math.round( domResizeHostRect.height );
|
|
newSize.height = Math.round( domResizeHostRect.height );
|
|
|
|
|
|
|
|
- // writer.setStyle( 'width', domHandleHostRect.width + 'px', this._options.viewElement );
|
|
|
|
|
-
|
|
|
|
|
this.redraw( domHandleHostRect, writer );
|
|
this.redraw( domHandleHostRect, writer );
|
|
|
|
|
|
|
|
this.state.update( newSize );
|
|
this.state.update( newSize );
|
|
@@ -225,7 +206,6 @@ export default class Resizer {
|
|
|
* @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
|
|
* @param {module:utils/dom/rect~Rect} [handleHostRect] Handle host rectangle might be given to improve performance.
|
|
|
*/
|
|
*/
|
|
|
redraw( handleHostRect, writer ) {
|
|
redraw( handleHostRect, writer ) {
|
|
|
- // TODO review this
|
|
|
|
|
const domWrapper = this._domResizerWrapper;
|
|
const domWrapper = this._domResizerWrapper;
|
|
|
|
|
|
|
|
if ( existsInDom( domWrapper ) ) {
|
|
if ( existsInDom( domWrapper ) ) {
|