# @masd.lab on Instagram

- **Type:** Video
- **Original URL:** https://www.instagram.com/p/DCCuiSfs6uE
- **Gondola URL:** https://gondola.cc/posts/61255903-masdlab-instagram
- **Thumbnail:** https://img.gondola.cc/tr:w-,h-,fo-auto/postThumbnails/c48ce82e4d.jpg
- **Posted:** 2024-11-06T20:03:07.000+00:00
- **Account Owner:** Marcos Silva (@masd.lab) — https://gondola.cc/masd.lab

## Caption

Expression n.7 circle.Fits.Text
explainer: https://bit.ly/4fzEoEV

This expression pair automatically adjusts the scale and position of a circular shape layer to fit a text layer’s bounding box. Ideal for creating dynamically adjusting backgrounds or highlight circles, it keeps the shape layer centered and proportionate to the text’s dimensions, even when the text size changes.

Apply on Shape Layer Scale Property:

var textLayer = thisComp.layer(“TextLayer”);
var textRect = textLayer.sourceRectAtTime(time, false);
var padding = 20;
var circleDiameter = Math.max(textRect.width, textRect.height) + padding * 2;
var circleSize = thisLayer.content(“Ellipse 1”).content(“Ellipse Path 1”).size[0];
var scaleValue = (circleDiameter / circleSize) * 100;
[scaleValue, scaleValue];

Apply on Shape Layer Position Property:

var textLayer = thisComp.layer(“TextLayer”);
var textRect = textLayer.sourceRectAtTime(time, false);
var textCenter = [textRect.left + textRect.width / 2, textRect.top + textRect.height / 2];
var textPos = textLayer.toComp(textCenter);
textPos;

Find more in Links on Bio

#AfterEffects #AETips #MotionDesign #ExpressionMagic #DynamicScaling #TextAlignment #DesignTutorial #MotionGraphics #CreativeEffects #AEExpressions #AutoCentering #VisualEffects #AnimationTips

## Stats

- **Views:** 1,945
- **Likes:** 332
- **Shares:** 0
- **Comments:** 4

## Tags

expressionmagic, creativeeffects, aeexpressions, autocentering, textalignment, visualeffects, aetips, dynamicscaling, designtutorial, aftereffects, motiongraphics, motiondesign, animationtips

---
Copyright (c) Gondola