Inkscape extension that aligns selected objects on their true centres: the centre of area, not the bounding box.
A triangle does not sit in the middle of its own bounding box, so centring nested triangles the normal way leaves uneven borders. This lines up their real centres instead.
Works on any shape. Groups align by the combined mass of their contents. Zero-area and non-path objects (open strokes, text, images) fall back to their bounding-box centre. With nothing usable selected it does nothing, silently.
Inkscape 1.x on macOS, Linux or Windows. Built against 1.4.4 / inkex 1.4.0. Python ships with Inkscape.
git clone https://github.com/JunaidQadirB/inkscape-true-center-align
cd inkscape-true-center-align
./install.sh # macOS, Linux
install.bat # Windows
python3 install.py # anywhereRestart Inkscape. Use --dry-run to preview, --help for options.
Clone anywhere; the installer copies the extension into place. If the clone is
already in Inkscape's extensions/ directory it stays put, so git pull
updates it.
Everything goes in the Inkscape user profile, nothing in the application.
| Path in the profile | What |
|---|---|
extensions/true_center_align/ |
the extension |
icons/hicolor/*/actions/true-center-align*.svg |
the icon |
ui/align-and-distribute.ui |
patched dialog with the new button |
keys/default.xml |
the shortcut |
The installer asks Inkscape for its own directories rather than guessing:
| Profile | |
|---|---|
| macOS | ~/Library/Application Support/org.inkscape.Inkscape/config/inkscape |
| Linux | ~/.config/inkscape |
| Windows | %APPDATA%\inkscape |
Override with --inkscape, --profile, --share, or INKSCAPE_BIN,
INKSCAPE_PROFILE_DIR, INKSCAPE_SHARE.
Re-run the installer. ui/align-and-distribute.ui is generated from the
installed Inkscape, not shipped, so it rebuilds against the new dialog instead
of pinning an old layout. The previous copy is kept as .ui.bak. Delete the
file from the profile to restore the stock dialog.
keys/default.xml is merged, not overwritten.
Ctrl+Alt+Shift+C, or Cmd+Opt+Shift+C on macOS.
Simpler combinations clash with the OS: Alt+Shift switches input language on
Windows, Option+Shift+letter types accented characters on macOS. Override with
install.py --shortcut '<primary><alt>k'; the installer warns on conflicts with
Inkscape's own keymap.
Change it in Preferences > Interface > Keyboard. Search for
true-center-align, not the display name: Inkscape labels extension rows with
the <menu-tip> text. That dialog writes to the same keys/default.xml, and
the installer merges rather than overwrites, so your choice survives re-runs.
Inkscape parses the keys file before extensions register their actions, and logs
Shortcuts::add_shortcut: No Action for org.jq.true-center-align.noprefs at
startup. It does the same for its own bundled extensions. If the key does not
fire, set it in Preferences.
python3 tools/make_package.pyBuilds dist/true_center_align-<VERSION>.zip and dist/thumbnail-190.png.
Bump VERSION first.
The Extension Manager installs into extensions, templates, palettes,
symbols and keys only. ui and icons are commented out in inkman's
targets.py as having no website category, so a gallery install gives the menu
entry alone. The archive carries install.py so users can add the rest.
To submit: upload the zip to inkscape.org under the
Extensions category, add the thumbnail, tag the Inkscape versions it works on
(the manager filters on this), then ask for a review. The manager queries with
checked=1, so uncurated entries are invisible from inside Inkscape.
The dialog button cannot grey itself out. Button sensitivity comes from the action's enabled state, which for extension actions lives in Inkscape's own code. Its built-in align buttons are not selection-sensitive either.
GPL-2.0-or-later, matching inkex. Full text in LICENSE.
true_center_align.py the extension
true_center_align.inx its Inkscape manifest
icons/ icon for the Extensions listing
profile/icons/ icon theme installed into the profile
install.py installer
install.sh / install.bat wrappers
tools/inkscape_paths.py locates Inkscape per platform
tools/patch_align_ui.py generates the patched dialog
tools/merge_shortcut.py merges the shortcut, detects conflicts
tools/make_package.py builds the gallery zip
gallery/thumbnail.svg gallery listing image