Only fix selection aspect ratio on images

This commit is contained in:
acer 2020-11-07 00:35:09 -05:00
parent 14c7b9e8e0
commit 56377c00b2
3 changed files with 7 additions and 4 deletions

View File

@ -101,10 +101,13 @@ class Select_tool_class extends Base_tools_class {
var mouse = this.get_mouse_info(e);
if (mouse.valid == false || mouse.click_valid == false)
return;
if (this.Base_selection.mouse_lock != null)
if (this.Base_selection.mouse_lock != null) {
this.Base_selection.find_settings().keep_ratio = config.layer.type === 'image';
return;
}
this.auto_select_object(e);
this.Base_selection.find_settings().keep_ratio = config.layer.type === 'image';
this.saved = false;
this.last_post = {

View File

@ -1563,14 +1563,14 @@ class Text_class extends Base_tools_class {
*/
resize_to_dynamic_bounds(layer, editor) {
if (layer.params.boundary === 'dynamic') {
if (layer && layer.params && layer.params.boundary === 'dynamic') {
layer.width = editor.textBoundaryWidth + 1;
layer.height = editor.textBoundaryHeight + 1;
}
}
extend_fixed_bounds(layer, editor) {
if (layer.params.boundary !== 'dynamic') {
if (layer && layer.params && layer.params.boundary !== 'dynamic') {
const params = this.getParams();
const isHorizontalTextDirection = ['ltr', 'rtl'].includes(params.textDirection);
if (isHorizontalTextDirection) {

View File

@ -53,7 +53,7 @@ module.exports = {
],
devtool: "cheap-module-source-map",
devServer: {
host: '0.0.0.0',
// host: '0.0.0.0',
contentBase: "./",
compress: true,
}