Svg scale start again when svg size is too big

Hi everyone,
I’m new in processing dev, I have this code to scale a svg, I don’t know how to start again the scale when the svg go out the screen, like being at the original size and position .

PShape bot;
boolean kk= false;
Timer timer_tree;

void setup() {
  size(1900, 1000, P3D);
  // The file "bot1.svg" must be in the data folder
  // of the current sketch to load successfully
bot = loadShape("kk.svg");
    timer_tree = new Timer(2000);

void draw(){
if (timer_tree.isFinished()) {
bot.disableStyle();  // Ignore the colors in the SVG
  fill(255);    // Set the SVG fill to white
   shapeMode(CENTER); // set shape origin to the center of the shape
 shape(bot, 280, 40); 
    bot.scale(1.01, 1.01, 1.01);  // Draw at coordinate (280, 40) at the default size 

Hi @yves ,

Welcome to the forum! :wink:

Do you want to animate the scale of the SVG and if the SVG becomes bigger than the size of the window, you reset its scale?

Hi Josephh,
thank’s for the answer, yes that’s it.
like a loop, the scale becomes bigger and bigger, and when he’s bigger than the window, it starts at the coords and the original size and zoom again.
And I would like to make it for many shapes, what’s the best way to do that ?
thank’s again