Glimmr Canvas Editor

version 1/100805 by Erik Temple

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Center-aligning a string

    Center-aligning a string is an action applying to nothing. Understand "center string" or "center text" or "center-alignment" as center-aligning a string.

    Carry out center-aligning a string:
        now the current text alignment is centered;
        if the number of entries of the element-selection set > 0:
            let count be 0;
            repeat with item running through the element-selection set:
                if item is a rendered string:
                    increase count by 1;
                    now the item is center-aligned;
            if count is 0:
                say "New text strings will be centered. [bracket]Selected items are not text strings and were not affected.[close bracket][line break]";
                rule fails;
            otherwise:
                say "Text alignment changed[if count > 1] for [count] items[end if][if count < the number of entries of the element-selection set]. Some elements are not strings and were not affected[end if].";
        otherwise:
            say "New text strings will be centered.";
        update drawing window buttons;
        follow the window-drawing rules for the working window;
        follow the window-drawing rules for the drawing-window.