https://bugs.kde.org/show_bug.cgi?id=388961

Boudewijn Rempt <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Usability                   |Scripting
     Ever confirmed|0                           |1
             Status|REPORTED                    |CONFIRMED
           Severity|wishlist                    |normal

--- Comment #7 from Boudewijn Rempt <[email protected]> ---
You could also use the Grow mode of the crop tool for this. In theory, a simple
python script like 

from krita import *
d = Krita.instance().activeDocument()
w = d.width()
h = d.height()
x = d.xOffset()
y = d.yOffset()

print(x, y, w, h)

for n in d.topLevelNodes():
    print (n, n.bounds())
    b = n.bounds()
    if b.x() < x:
        x = b.x()
    if b.y() < y:
        y = b.y()
    if b.x() + b.width() > w:
        w = b.x() + b.width()
    if b.y() + b.height() > h:
        h = b.y() + b.height()

print (x, y, w, h)       

d.setXOffset(x)
d.setYOffset(y)
d.setWidth(w)
d.setHeight(h)

Should do the trick, but setting the image dimensions seems to be broken. Which
makes this a bug...

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to