include a better Wilber path, thanks to Jimmac.

2008-03-26  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpcairo-wilber.c: include a better Wilber path,
	thanks to Jimmac.

	* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): undid
	scaling "fix", instead take the offset into account. Draw with
	transparency.

svn path=/trunk/; revision=25246
This commit is contained in:
Sven Neumann 2008-03-26 17:25:00 +00:00 committed by Sven Neumann
parent 00b3334d1f
commit 3f2120ed09
3 changed files with 24 additions and 13 deletions

View File

@ -1,3 +1,12 @@
2008-03-26 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcairo-wilber.c: include a better Wilber path,
thanks to Jimmac.
* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): undid
scaling "fix", instead take the offset into account. Draw with
transparency.
2008-03-26 Michael Natterer <mitch@gimp.org> 2008-03-26 Michael Natterer <mitch@gimp.org>
* app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): fix scaling. * app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): fix scaling.

View File

@ -828,6 +828,8 @@ void
gimp_canvas_draw_drop_zone (GimpCanvas *canvas, gimp_canvas_draw_drop_zone (GimpCanvas *canvas,
cairo_t *cr) cairo_t *cr)
{ {
static gint wilber_x = 0;
static gint wilber_y = 0;
static gint wilber_width = 0; static gint wilber_width = 0;
static gint wilber_height = 0; static gint wilber_height = 0;
@ -848,6 +850,8 @@ gimp_canvas_draw_drop_zone (GimpCanvas *canvas,
cairo_fill_extents (foo, &x1, &y1, &x2, &y2); cairo_fill_extents (foo, &x1, &y1, &x2, &y2);
cairo_destroy (foo); cairo_destroy (foo);
wilber_x = x1;
wilber_y = y1;
wilber_width = (x2 - x1) / 2; wilber_width = (x2 - x1) / 2;
wilber_height = (y2 - y1) / 2; wilber_height = (y2 - y1) / 2;
} }
@ -868,11 +872,17 @@ gimp_canvas_draw_drop_zone (GimpCanvas *canvas,
/* magic factors depend on the image used, everything else is generic /* magic factors depend on the image used, everything else is generic
*/ */
cairo_translate (cr, cairo_translate (cr,
- wilber_width * 1.5, - wilber_width * 0.6 - wilber_x,
widget->allocation.height / factor - wilber_height * 1.7); widget->allocation.height / factor
- wilber_height * 1.1 - wilber_y);
gimp_cairo_wilber (cr); gimp_cairo_wilber (cr);
cairo_set_source_rgba (cr,
widget->style->fg[widget->state].red / 65535.0,
widget->style->fg[widget->state].green / 65535.0,
widget->style->fg[widget->state].blue / 65535.0,
0.2);
cairo_fill (cr); cairo_fill (cr);
} }

View File

@ -33,13 +33,8 @@
#include <gimpcairo-wilber.h> #include <gimpcairo-wilber.h>
static const gchar * const wilber_paths[] = static const gchar wilber_path[] =
{ "M 509.72445,438.68864 C 501.47706,469.77945 464.95038,491.54566 431.85915,497.74874 C 438.5216,503.01688 442.87782,511.227 442.87782,520.37375 C 442.87783,536.24746 429.95607,549.0223 414.08235,549.0223 C 398.20863,549.0223 385.28688,536.24746 385.28688,520.37375 C 385.28688,511.52403 389.27666,503.61286 395.57098,498.3364 C 359.36952,495.90384 343.70976,463.95812 343.70975,463.95814 L 342.68134,509.64891 C 342.68134,514.35021 342.08391,519.96098 340.18378,528.3072 C 339.84664,527.80364 339.51399,527.33515 339.15537,526.83804 C 330.25511,514.5011 317.25269,507.81431 306.39317,508.76741 C 302.77334,509.08511 299.47017,510.33348 296.54982,512.4403 C 284.86847,520.86757 284.97665,540.94721 296.84366,557.3965 C 306.96274,571.42287 322.32232,578.25612 333.8664,574.73254 C 391.94635,615.17624 532.16931,642.41915 509.72445,438.68864 z M 363.24953,501.1278 C 373.83202,501.12778 382.49549,509.79127 382.49549,520.37375 C 382.49549,530.95624 373.83201,539.47279 363.24953,539.47279 C 352.66706,539.47279 344.1505,530.95624 344.1505,520.37375 C 344.15049,509.79129 352.66706,501.1278 363.24953,501.1278 z M 305.80551,516.1132 C 311.68466,516.11318 316.38344,521.83985 316.38344,528.89486 C 316.38345,535.94982 311.68467,541.67652 305.80551,541.67652 C 299.92636,541.67652 295.08067,535.94987 295.08067,528.89486 C 295.08065,521.83985 299.92636,516.1132 305.80551,516.1132 z M 440.821,552.54828 C 440.821,552.54828 448.7504,554.02388 453.8965,559.45332 C 457.41881,563.16951 457.75208,569.15506 456.98172,577.37703 C 456.21143,573.8833 454.89571,571.76659 453.8965,569.29666 C 443.01388,582.47662 413.42981,583.08929 376.0312,569.88433 C 416.63248,578.00493 437.38806,570.56014 449.48903,561.2163 C 446.29383,557.08917 440.821,552.54828 440.821,552.54828 z M 434.64723,524.59684 C 434.64723,532.23974 428.44429,538.44268 420.80139,538.44268 C 413.15849,538.44268 406.95555,532.23974 406.95555,524.59684 C 406.95555,516.95394 413.15849,510.751 420.80139,510.751 C 428.44429,510.751 434.64723,516.95394 434.64723,524.59684 z M 378.00043,522.99931 C 378.00043,527.70264 374.18324,531.51984 369.47991,531.51984 C 364.77658,531.51984 360.95939,527.70264 360.95939,522.99931 C 360.95939,518.29599 364.77658,514.47879 369.47991,514.47879 C 374.18324,514.47879 378.00043,518.29599 378.00043,522.99931 z ";
"M 10.374369,12.467884 C 10.374369,12.467884 13.248878,18.395518 19.973611,18.228291 C 34.066126,17.874738 36.53732,10.523341 36.890873,9.4626804 C 37.244427,8.4020202 37.785407,8.5626825 37.91048,9.542947 C 42.506674,51.262247 6.0135488,33.362123 4.7175144,26.256467 C 11.965359,24.135147 10.197592,20.069282 10.197592,20.069282 L 10.374369,12.467884 z ",
"M 15.73779,30.066049 C 22.47669,31.413886 25.908481,30.164142 27.916965,28.613273 C 27.386635,27.928263 26.480655,27.176962 26.480655,27.176962 C 26.480655,27.176962 28.833972,27.830904 29.662635,28.900535 C 30.488925,29.967103 29.969443,30.624242 29.753196,31.988905 C 29.271785,30.790306 28.373215,30.340813 28.251562,29.864573 C 26.445294,32.3615 21.94512,32.257773 15.73779,30.066049 z "
"M 23.003067,31.736544 C 24.500439,31.879636 25.852696,31.464331 26.41496,31.262497 C 26.513185,30.707111 26.951512,29.64124 28.461048,29.571029 L 27.930718,28.642952 C 27.930718,28.642952 25.964077,29.990873 23.864854,30.388621 L 23.003067,31.736544 z ",
NULL
};
static void parse_path_data (cairo_t *cr, static void parse_path_data (cairo_t *cr,
const gchar *data); const gchar *data);
@ -48,10 +43,7 @@ static void parse_path_data (cairo_t *cr,
void void
gimp_cairo_wilber (cairo_t *cr) gimp_cairo_wilber (cairo_t *cr)
{ {
gint i; parse_path_data (cr, wilber_path);
for (i = 0; wilber_paths[i]; i++)
parse_path_data (cr, wilber_paths[i]);
} }