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

Function manualKeyframe

src/js/functions.js:2309–2391  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2307
2308// Create a keyframe (manually)
2309function manualKeyframe() {
2310 var prop = $(this).parent().attr('data-property');
2311 const object = canvas.getItemById(
2312 $(this).parent().parent().parent().attr('data-object')
2313 );
2314 if (prop == 'position') {
2315 prop = 'left';
2316 newKeyframe('top', object, currenttime, object.get('top'), true);
2317 } else if (prop == 'scale') {
2318 prop = 'scaleX';
2319 newKeyframe(
2320 'scaleY',
2321 object,
2322 currenttime,
2323 object.get('scaleY'),
2324 true
2325 );
2326 newKeyframe(
2327 'width',
2328 object,
2329 currenttime,
2330 object.get('width'),
2331 true
2332 );
2333 newKeyframe(
2334 'height',
2335 object,
2336 currenttime,
2337 object.get('height'),
2338 true
2339 );
2340 } else if (prop == 'stroke') {
2341 prop = 'strokeWidth';
2342 newKeyframe(
2343 'stroke',
2344 object,
2345 currenttime,
2346 object.get('stroke'),
2347 true
2348 );
2349 } else if (prop == 'shadow') {
2350 prop = 'shadow.color';
2351 newKeyframe(
2352 'shadow.opacity',
2353 object,
2354 currenttime,
2355 object.get('shadow.opacity'),
2356 true
2357 );
2358 newKeyframe(
2359 'shadow.offsetX',
2360 object,
2361 currenttime,
2362 object.get('shadow.offsetX'),
2363 true
2364 );
2365 newKeyframe(
2366 'shadow.offsetY',

Callers

nothing calls this directly

Calls 3

newKeyframeFunction · 0.85
saveFunction · 0.85
$Function · 0.50

Tested by

no test coverage detected