summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a397e8)
raw | patch | inline | side by side (parent: 3a397e8)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 24 Aug 2007 02:19:06 +0000 (02:19 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 24 Aug 2007 02:19:06 +0000 (02:19 +0000) |
src/display/sodipodi-ctrlrect.cpp | patch | blob | history |
index 05449f2bb146aeb6a572ad940f3c70afbdb7bf1d..1eee3a860ee243aadbcfcb6f89bbe59e0e9b343e 100644 (file)
_shadow = 0;
_area.x0 = _area.y0 = 0;
- _area.x1 = _area.y1 = -1;
+ _area.x1 = _area.y1 = 0;
+
+ _rect = NR::Rect(NR::Point(0,0),NR::Point(0,0));
_shadow_size = 0;
void CtrlRect::render(SPCanvasBuf *buf)
{
- if ((_area.x0 < buf->rect.x1) &&
+ if ((_area.x0 != 0 || _area.x1 != 0 || _area.y0 != 0 || _area.y1 != 0) &&
+ (_area.x0 < buf->rect.x1) &&
(_area.y0 < buf->rect.y1) &&
((_area.x1 + _shadow_size) >= buf->rect.x0) &&
((_area.y1 + _shadow_size) >= buf->rect.y0)) {
sp_canvas_item_reset_bounds(this);
- /* Request redraw old */
- if (!_has_fill) {
- /* Top */
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y0 - 1,
- _area.x1 + 1, _area.y0 + 1);
- /* Left */
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y0 - 1,
- _area.x0 + 1, _area.y1 + 1);
- /* Right */
- sp_canvas_request_redraw(canvas,
- _area.x1 - 1, _area.y0 - 1,
- _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
- /* Bottom */
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y1 - 1,
- _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
- } else {
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y0 - 1,
- _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ if (_area.x0 != 0 || _area.x1 != 0 || _area.y0 != 0 || _area.y1 != 0) {
+ /* Request redraw old */
+ if (!_has_fill) {
+ /* Top */
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y0 - 1,
+ _area.x1 + 1, _area.y0 + 1);
+ /* Left */
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y0 - 1,
+ _area.x0 + 1, _area.y1 + 1);
+ /* Right */
+ sp_canvas_request_redraw(canvas,
+ _area.x1 - 1, _area.y0 - 1,
+ _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ /* Bottom */
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y1 - 1,
+ _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ } else {
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y0 - 1,
+ _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ }
}
NR::Rect bbox(_rect.min() * affine, _rect.max() * affine);
_area.y1 = (int) floor(bbox.max()[NR::Y] + 0.5);
_shadow_size = _shadow;
-
- /* Request redraw new */
- if (!_has_fill) {
- /* Top */
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y0 - 1,
- _area.x1 + 1, _area.y0 + 1);
- /* Left */
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y0 - 1,
- _area.x0 + 1, _area.y1 + 1);
- /* Right */
- sp_canvas_request_redraw(canvas,
- _area.x1 - 1, _area.y0 - 1,
- _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
- /* Bottom */
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y1 - 1,
- _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
- } else {
- sp_canvas_request_redraw(canvas,
- _area.x0 - 1, _area.y0 - 1,
- _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+
+ if (_area.x0 != 0 || _area.x1 != 0 || _area.y0 != 0 || _area.y1 != 0) {
+ /* Request redraw new */
+ if (!_has_fill) {
+ /* Top */
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y0 - 1,
+ _area.x1 + 1, _area.y0 + 1);
+ /* Left */
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y0 - 1,
+ _area.x0 + 1, _area.y1 + 1);
+ /* Right */
+ sp_canvas_request_redraw(canvas,
+ _area.x1 - 1, _area.y0 - 1,
+ _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ /* Bottom */
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y1 - 1,
+ _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ } else {
+ sp_canvas_request_redraw(canvas,
+ _area.x0 - 1, _area.y0 - 1,
+ _area.x1 + _shadow_size + 1, _area.y1 + _shadow_size + 1);
+ }
+
+ x1 = _area.x0 - 1;
+ y1 = _area.y0 - 1;
+ x2 = _area.x1 + _shadow_size + 1;
+ y2 = _area.y1 + _shadow_size + 1;
}
-
- x1 = _area.x0 - 1;
- y1 = _area.y0 - 1;
- x2 = _area.x1 + _shadow_size + 1;
- y2 = _area.y1 + _shadow_size + 1;
+
}