MCPcopy
hub / github.com/alyssaxuu/motionity / updateObjectValues

Function updateObjectValues

src/js/ui.js:675–833  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

673
674// Update object position based on panel input values
675function 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();

Callers 1

updatePanelFunction · 0.85

Calls 14

autoSaveFunction · 0.85
saveFunction · 0.85
newKeyframeFunction · 0.85
updateInputsFunction · 0.85
keyframeChangesFunction · 0.85
reselectFunction · 0.85
updatePanelValuesFunction · 0.85
resizeCanvasFunction · 0.85
updatePanelFunction · 0.85
setDurationFunction · 0.85
setPropMethod · 0.80
setColorMethod · 0.80

Tested by

no test coverage detected