[Kst] extragear/graphics/kst/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Thu Dec 1 02:22:03 CET 2005
SVN commit 484490 by netterfield:
Margins!
M +7 -5 kstviewlabel.cpp
--- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #484489:484490
@@ -248,7 +248,7 @@
switch (hJust) {
case KST_JUSTIFY_H_RIGHT:
rc.x = -_textWidth / 2;
- tx = size().width() - int(_textWidth * abcos + _textHeight * absin) / 2 - borderWidth();
+ tx = size().width() - int(_textWidth * abcos + _textHeight * absin) / 2 - borderWidth() - padding();
break;
case KST_JUSTIFY_H_CENTER:
rc.x = -_textWidth / 2;
@@ -259,14 +259,14 @@
case KST_JUSTIFY_H_LEFT:
default:
rc.x = -_textWidth / 2;
- tx = int(_textWidth * abcos + _textHeight * absin) / 2 + borderWidth();
+ tx = int(_textWidth * abcos + _textHeight * absin) / 2 + borderWidth() + padding();
break;
}
switch (KST_JUSTIFY_V(_justify)) {
case KST_JUSTIFY_V_BOTTOM:
rc.y = _ascent - _textHeight / 2;
- ty = size().height() - int(_textHeight * abcos + _textWidth * absin) / 2 - borderWidth();
+ ty = size().height() - int(_textHeight * abcos + _textWidth * absin) / 2 - borderWidth() - padding();
break;
case KST_JUSTIFY_V_CENTER:
rc.y = _ascent - _textHeight / 2;
@@ -276,7 +276,7 @@
case KST_JUSTIFY_V_TOP:
default:
rc.y = _ascent - _textHeight / 2;
- ty = int(_textHeight * abcos + _textWidth * absin) / 2 + borderWidth();
+ ty = int(_textHeight * abcos + _textWidth * absin) / 2 + borderWidth() + padding();
break;
}
@@ -463,7 +463,7 @@
}
}
- resize(sz + QSize(borderWidth()*2, borderWidth()*2));
+ resize(sz + QSize((borderWidth()+padding())*2, (borderWidth()+padding())*2));
}
@@ -611,6 +611,7 @@
widget->_border->setValue(borderWidth());
widget->_boxColors->setForeground(borderColor());
widget->_boxColors->setBackground(backgroundColor());
+ widget->_margin->setValue(padding());
}
return true;
}
@@ -641,6 +642,7 @@
setBorderWidth(widget->_border->value());
setBorderColor(widget->_boxColors->foreground());
setBackgroundColor(widget->_boxColors->background());
+ setPadding(widget->_margin->value());
reparse(); // calls setDirty()
return true;
More information about the Kst
mailing list