(type)
| 673 | |
| 674 | // Update object position based on panel input values |
| 675 | function updateObjectValues(type) { |
| 676 | autoSave(); |
| 677 | if (canvas.getActiveObjects().length > 0) { |
| 678 | if ($(this).find('input').val() || type) { |
| 679 | var object = canvas.getActiveObject(); |
| 680 | if ($(this).attr('id') == 'animated-text') { |
| 681 | return false; |
| 682 | } |
| 683 | if ($(this).attr('id') == 'animated-text-duration') { |
| 684 | var obj = p_keyframes.find((x) => x.id == object.id); |
| 685 | var length = obj.end - obj.start; |
| 686 | if ($(this).find('input').val() * 1000 > length) { |
| 687 | $(this) |
| 688 | .find('input') |
| 689 | .val(length / 1000); |
| 690 | } |
| 691 | animatedtext |
| 692 | .find((x) => x.id == object.id) |
| 693 | .setProp( |
| 694 | { duration: $(this).find('input').val() * 1000 }, |
| 695 | canvas |
| 696 | ); |
| 697 | save(); |
| 698 | return false; |
| 699 | } |
| 700 | if ($(this).attr('id') == 'object-volume') { |
| 701 | newKeyframe( |
| 702 | 'volume', |
| 703 | canvas.getActiveObject(), |
| 704 | currenttime, |
| 705 | parseFloat($(this).find('input').val()) / 200, |
| 706 | true |
| 707 | ); |
| 708 | canvas |
| 709 | .getActiveObject() |
| 710 | .set( |
| 711 | 'volume', |
| 712 | parseFloat($(this).find('input').val()) / 200 |
| 713 | ); |
| 714 | } |
| 715 | editingpanel = true; |
| 716 | var selection = false; |
| 717 | const tempselection = canvas.getActiveObjects(); |
| 718 | const id = $(this).attr('id'); |
| 719 | updateInputs(id); |
| 720 | if (tempselection.length > 1) { |
| 721 | object = object.toGroup(); |
| 722 | selection = true; |
| 723 | } |
| 724 | if (objects.find((x) => x.id == object.get('id'))) { |
| 725 | objects.find((x) => x.id == object.get('id')).mask = |
| 726 | $('#masks').val(); |
| 727 | if ($('#masks').val() == 'none') { |
| 728 | object.clipPath = null; |
| 729 | canvas.renderAll(); |
| 730 | } else { |
| 731 | object.clipPath = canvas.getItemById($('#masks').val()); |
| 732 | canvas.renderAll(); |
no test coverage detected