diff options
Diffstat (limited to 'libmetacity/meta-draw-op.c')
-rw-r--r-- | libmetacity/meta-draw-op.c | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/libmetacity/meta-draw-op.c b/libmetacity/meta-draw-op.c index 108e9953..def8033b 100644 --- a/libmetacity/meta-draw-op.c +++ b/libmetacity/meta-draw-op.c @@ -51,11 +51,11 @@ struct _MetaDrawOpList static void fill_env (MetaPositionExprEnv *env, const MetaDrawInfo *info, - GdkRectangle logical_region) + MetaRectangleDouble rect) { /* FIXME this stuff could be raised into draw_op_list_draw() probably */ - env->rect = logical_region; + env->rect = rect; env->object_width = -1; env->object_height = -1; @@ -63,8 +63,8 @@ fill_env (MetaPositionExprEnv *env, env->right_width = info->right_width; env->top_height = info->top_height; env->bottom_height = info->bottom_height; - env->frame_x_center = info->width / 2 - logical_region.x; - env->frame_y_center = info->height / 2 - logical_region.y; + env->frame_x_center = info->width / 2 - rect.x; + env->frame_y_center = info->height / 2 - rect.y; env->mini_icon_width = info->mini_icon ? gdk_pixbuf_get_width (info->mini_icon) : 0; env->mini_icon_height = info->mini_icon ? gdk_pixbuf_get_height (info->mini_icon) : 0; @@ -78,8 +78,8 @@ fill_env (MetaPositionExprEnv *env, static cairo_surface_t * scale_surface (GdkPixbuf *src, MetaImageFillType fill_type, - gint width, - gint height, + gdouble width, + gdouble height, gboolean vertical_stripes, gboolean horizontal_stripes) { @@ -219,8 +219,8 @@ static cairo_surface_t * draw_op_as_surface (const MetaDrawOp *op, GtkStyleContext *context, const MetaDrawInfo *info, - gint width, - gint height) + gdouble width, + gdouble height) { cairo_surface_t *surface; @@ -337,7 +337,6 @@ draw_op_draw_with_env (const MetaDrawOp *op, GtkStyleContext *context, cairo_t *cr, const MetaDrawInfo *info, - GdkRectangle rect, MetaPositionExprEnv *env) { GdkRGBA color; @@ -350,7 +349,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, { case META_DRAW_LINE: { - int x1, x2, y1, y2; + gdouble x1, x2, y1, y2; meta_color_spec_render (op->data.line.color_spec, context, &color); gdk_cairo_set_source_rgba (cr, &color); @@ -370,9 +369,8 @@ draw_op_draw_with_env (const MetaDrawOp *op, x1 = meta_draw_spec_parse_x_position (op->data.line.x1, env); y1 = meta_draw_spec_parse_y_position (op->data.line.y1, env); - if (!op->data.line.x2 && - !op->data.line.y2 && - op->data.line.width==0) + if (!op->data.line.x2 && !op->data.line.y2 && + op->data.line.width == 0) { cairo_rectangle (cr, x1, y1, 1, 1); cairo_fill (cr); @@ -425,7 +423,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_RECTANGLE: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; meta_color_spec_render (op->data.rectangle.color_spec, context, &color); gdk_cairo_set_source_rgba (cr, &color); @@ -453,7 +451,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_ARC: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; double start_angle, end_angle; double center_x, center_y; @@ -498,7 +496,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_TINT: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; rx = meta_draw_spec_parse_x_position (op->data.tint.x, env); ry = meta_draw_spec_parse_y_position (op->data.tint.y, env); @@ -513,7 +511,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_GRADIENT: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; rx = meta_draw_spec_parse_x_position (op->data.gradient.x, env); ry = meta_draw_spec_parse_y_position (op->data.gradient.y, env); @@ -528,7 +526,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_IMAGE: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; cairo_surface_t *surface; if (op->data.image.pixbuf) @@ -573,7 +571,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_GTK_ARROW: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; double angle = 0, size; rx = meta_draw_spec_parse_x_position (op->data.gtk_arrow.x, env); @@ -610,7 +608,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_GTK_BOX: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; rx = meta_draw_spec_parse_x_position (op->data.gtk_box.x, env); ry = meta_draw_spec_parse_y_position (op->data.gtk_box.y, env); @@ -625,7 +623,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_GTK_VLINE: { - int rx, ry1, ry2; + gdouble rx, ry1, ry2; rx = meta_draw_spec_parse_x_position (op->data.gtk_vline.x, env); ry1 = meta_draw_spec_parse_y_position (op->data.gtk_vline.y1, env); @@ -638,7 +636,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_ICON: { - int rx, ry, rwidth, rheight; + gdouble rx, ry, rwidth, rheight; cairo_surface_t *surface; rwidth = meta_draw_spec_parse_size (op->data.icon.width, env); @@ -678,7 +676,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_TITLE: if (info->title_layout) { - int rx, ry; + gdouble rx, ry; PangoRectangle ink_rect, logical_rect; meta_color_spec_render (op->data.title.color_spec, context, &color); @@ -689,7 +687,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, if (op->data.title.ellipsize_width) { - int ellipsize_width; + gdouble ellipsize_width; int right_bearing; ellipsize_width = meta_draw_spec_parse_x_position (op->data.title.ellipsize_width, env); @@ -757,7 +755,7 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_OP_LIST: { - GdkRectangle d_rect; + MetaRectangleDouble d_rect; d_rect.x = meta_draw_spec_parse_x_position (op->data.op_list.x, env); d_rect.y = meta_draw_spec_parse_y_position (op->data.op_list.y, env); @@ -771,9 +769,9 @@ draw_op_draw_with_env (const MetaDrawOp *op, case META_DRAW_TILE: { - int rx, ry, rwidth, rheight; - int tile_xoffset, tile_yoffset; - GdkRectangle tile; + gdouble rx, ry, rwidth, rheight; + gdouble tile_xoffset, tile_yoffset; + MetaRectangleDouble tile; rx = meta_draw_spec_parse_x_position (op->data.tile.x, env); ry = meta_draw_spec_parse_y_position (op->data.tile.y, env); @@ -788,8 +786,8 @@ draw_op_draw_with_env (const MetaDrawOp *op, tile_xoffset = meta_draw_spec_parse_x_position (op->data.tile.tile_xoffset, env); tile_yoffset = meta_draw_spec_parse_y_position (op->data.tile.tile_yoffset, env); /* tile offset should not include x/y */ - tile_xoffset -= rect.x; - tile_yoffset -= rect.y; + tile_xoffset -= env->rect.x; + tile_yoffset -= env->rect.y; tile.width = meta_draw_spec_parse_size (op->data.tile.tile_width, env); tile.height = meta_draw_spec_parse_size (op->data.tile.tile_height, env); @@ -1107,7 +1105,7 @@ meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list, GtkStyleContext *context, cairo_t *cr, const MetaDrawInfo *info, - GdkRectangle rect) + MetaRectangleDouble rect) { int i; MetaPositionExprEnv env; @@ -1146,7 +1144,7 @@ meta_draw_op_list_draw_with_style (const MetaDrawOpList *op_list, } else if (gdk_cairo_get_clip_rectangle (cr, NULL)) { - draw_op_draw_with_env (op, context, cr, info, rect, &env); + draw_op_draw_with_env (op, context, cr, info, &env); } } |