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

Function keyframeChanges

src/js/functions.js:967–1176  ·  view source on GitHub ↗
(object, type, id, selection)

Source from the content-addressed store, hash-verified

965
966// Generate keyframes
967function keyframeChanges(object, type, id, selection) {
968 if (object.get('type') == 'rect') {
969 object.set({
970 rx: parseFloat($('#object-corners input').val()),
971 ry: parseFloat($('#object-corners input').val()),
972 });
973 } else if (object.get('type') == 'textbox') {
974 object.set({
975 charSpacing: parseFloat($('#text-h input').val()) * 10,
976 lineHeight: parseFloat($('#text-v input').val() / 100),
977 });
978 canvas.renderAll();
979 }
980 canvas.renderAll();
981 if (type && type == 'opacity') {
982 newKeyframe(
983 'opacity',
984 object,
985 currenttime,
986 object.get('opacity'),
987 true
988 );
989 } else if (type && type == 'opacity3') {
990 newKeyframe(
991 'charSpacing',
992 object,
993 currenttime,
994 object.get('charSpacing'),
995 true
996 );
997 newKeyframe(
998 'lineHeight',
999 object,
1000 currenttime,
1001 object.get('lineHeight'),
1002 true
1003 );
1004 } else {
1005 if (id == 'object-x' || id == 'object-y') {
1006 newKeyframe(
1007 'left',
1008 object,
1009 currenttime,
1010 object.get('left'),
1011 true
1012 );
1013 newKeyframe(
1014 'top',
1015 object,
1016 currenttime,
1017 object.get('top'),
1018 true
1019 );
1020 } else if (id == 'object-w' || id == 'object-h') {
1021 newKeyframe(
1022 'scaleX',
1023 object,
1024 currenttime,

Callers 1

updateObjectValuesFunction · 0.85

Calls 3

newKeyframeFunction · 0.85
saveFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected