mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
Change cogl_path_rectangle and cogl_path_round_rectangle to take x1,y1,x2,y2
This matches the changes to cogl_rectangle to improve consistency.
This commit is contained in:
parent
5d4c09369e
commit
cde05288b7
5
README
5
README
@ -260,8 +260,9 @@ Release Notes for Clutter 1.0
|
|||||||
cogl_set_source_texture (tex_handle);
|
cogl_set_source_texture (tex_handle);
|
||||||
cogl_polygon (verts, 3, TRUE);
|
cogl_polygon (verts, 3, TRUE);
|
||||||
|
|
||||||
* The arguments to cogl_rectangle have been changed - for consistency - from
|
* The arguments to cogl_rectangle, cogl_path_rectangle and
|
||||||
x1, y2, width, height, to x1, y1, x2, y2.
|
cogl_path_round_rectangle have been changed - for consistency - from
|
||||||
|
x, y, width, height, to x1, y1, x2, y2.
|
||||||
|
|
||||||
* A CoglMatrix type and utility API has been added; this is currently used to
|
* A CoglMatrix type and utility API has been added; this is currently used to
|
||||||
support describing texture matrices.
|
support describing texture matrices.
|
||||||
|
@ -290,18 +290,18 @@ void cogl_path_polygon (float *coords,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_path_rectangle:
|
* cogl_path_rectangle:
|
||||||
* @x: X coordinate of the top-left corner.
|
* @x1: X coordinate of the top-left corner.
|
||||||
* @y: Y coordinate of the top-left corner.
|
* @y1: Y coordinate of the top-left corner.
|
||||||
* @width: Rectangle width.
|
* @x2: X coordinate of the bottom-right corner.
|
||||||
* @height: Rectangle height.
|
* @y2: Y coordinate of the bottom-right corner.
|
||||||
*
|
*
|
||||||
* Constructs a rectangular shape at the given coordinates. If there
|
* Constructs a rectangular shape at the given coordinates. If there
|
||||||
* is an existing path this will start a new disjoint sub-path.
|
* is an existing path this will start a new disjoint sub-path.
|
||||||
**/
|
**/
|
||||||
void cogl_path_rectangle (float x,
|
void cogl_path_rectangle (float x1,
|
||||||
float y,
|
float y1,
|
||||||
float width,
|
float x2,
|
||||||
float height);
|
float y2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_path_ellipse:
|
* cogl_path_ellipse:
|
||||||
@ -320,21 +320,21 @@ void cogl_path_ellipse (float center_x,
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* cogl_path_round_rectangle:
|
* cogl_path_round_rectangle:
|
||||||
* @x: X coordinate of the top-left corner
|
* @x1: X coordinate of the top-left corner.
|
||||||
* @y: Y coordinate of the top-left corner
|
* @y1: Y coordinate of the top-left corner.
|
||||||
* @width: Width of the rectangle
|
* @x2: X coordinate of the bottom-right corner.
|
||||||
* @height: Height of the rectangle
|
* @y2: Y coordinate of the bottom-right corner.
|
||||||
* @radius: Radius of the corner arcs.
|
* @radius: Radius of the corner arcs.
|
||||||
* @arc_step: Angle increment resolution for subdivision of
|
* @arc_step: Angle increment resolution for subdivision of
|
||||||
* the corner arcs.
|
* the corner arcs.
|
||||||
*
|
*
|
||||||
* Constructs a rectangular shape with rounded corners. If there is an
|
* Constructs a rectangular shape with rounded corners. If there is an
|
||||||
* existing path this will start a new disjoint sub-path.
|
* existing path this will start a new disjoint sub-path.
|
||||||
**/
|
**/
|
||||||
void cogl_path_round_rectangle (float x,
|
void cogl_path_round_rectangle (float x1,
|
||||||
float y,
|
float y1,
|
||||||
float width,
|
float x2,
|
||||||
float height,
|
float y2,
|
||||||
float radius,
|
float radius,
|
||||||
float arc_step);
|
float arc_step);
|
||||||
|
|
||||||
|
@ -193,15 +193,15 @@ cogl_path_polygon (float *coords,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_path_rectangle (float x,
|
cogl_path_rectangle (float x1,
|
||||||
float y,
|
float y1,
|
||||||
float width,
|
float x2,
|
||||||
float height)
|
float y2)
|
||||||
{
|
{
|
||||||
cogl_path_move_to (x, y);
|
cogl_path_move_to (x1, y1);
|
||||||
cogl_path_line_to (x + width, y);
|
cogl_path_line_to (x2, y1);
|
||||||
cogl_path_line_to (x + width, y + height);
|
cogl_path_line_to (x2, y2);
|
||||||
cogl_path_line_to (x, y + height);
|
cogl_path_line_to (x1, y2);
|
||||||
cogl_path_close ();
|
cogl_path_close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,19 +327,19 @@ cogl_path_ellipse (float center_x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cogl_path_round_rectangle (float x,
|
cogl_path_round_rectangle (float x1,
|
||||||
float y,
|
float y1,
|
||||||
float width,
|
float x2,
|
||||||
float height,
|
float y2,
|
||||||
float radius,
|
float radius,
|
||||||
float arc_step)
|
float arc_step)
|
||||||
{
|
{
|
||||||
float inner_width = width - (radius * 2);
|
float inner_width = x2 - x1 - radius * 2;
|
||||||
float inner_height = height - (radius * 2);
|
float inner_height = y2 - y1 - radius * 2;
|
||||||
|
|
||||||
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
_COGL_GET_CONTEXT (ctx, NO_RETVAL);
|
||||||
|
|
||||||
cogl_path_move_to (x, y + radius);
|
cogl_path_move_to (x1, y1 + radius);
|
||||||
cogl_path_arc_rel (radius, 0,
|
cogl_path_arc_rel (radius, 0,
|
||||||
radius, radius,
|
radius, radius,
|
||||||
180,
|
180,
|
||||||
|
@ -461,10 +461,10 @@ cogl_pango_renderer_draw_box (PangoRenderer *renderer,
|
|||||||
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
CoglPangoRenderer *priv = COGL_PANGO_RENDERER (renderer);
|
||||||
|
|
||||||
cogl_set_source (priv->solid_material);
|
cogl_set_source (priv->solid_material);
|
||||||
cogl_path_rectangle ((float)(x),
|
cogl_path_rectangle (x,
|
||||||
(float)(y - height),
|
y - height,
|
||||||
(float)(width),
|
x + width,
|
||||||
(float)(height));
|
y);
|
||||||
cogl_path_stroke ();
|
cogl_path_stroke ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,10 +41,10 @@ path_shapes (gint x, gint y, gint width, gint height)
|
|||||||
cogl_path_line_to ((x + width * 4 / 15), (y + height * 4 / 5));
|
cogl_path_line_to ((x + width * 4 / 15), (y + height * 4 / 5));
|
||||||
cogl_path_close ();
|
cogl_path_close ();
|
||||||
|
|
||||||
cogl_path_rectangle ((x + width / 3),
|
cogl_path_rectangle (x + width / 3,
|
||||||
y,
|
y,
|
||||||
(width * 4 / 15),
|
x + width * 9 / 15,
|
||||||
(height * 4 / 5));
|
y + height * 4 / 5);
|
||||||
|
|
||||||
cogl_path_ellipse ((x + width * 4 / 5),
|
cogl_path_ellipse ((x + width * 4 / 5),
|
||||||
(y + height * 2 / 5),
|
(y + height * 2 / 5),
|
||||||
@ -73,8 +73,8 @@ make_clip_path (Clip *clip)
|
|||||||
case CLIP_RECTANGLE:
|
case CLIP_RECTANGLE:
|
||||||
cogl_path_rectangle (clip->x1,
|
cogl_path_rectangle (clip->x1,
|
||||||
clip->y1,
|
clip->y1,
|
||||||
(clip->x2 - clip->x1),
|
clip->x2,
|
||||||
(clip->y2 - clip->y1));
|
clip->y2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLIP_ELLIPSE:
|
case CLIP_ELLIPSE:
|
||||||
|
@ -16,13 +16,13 @@ test_paint_line ()
|
|||||||
static void
|
static void
|
||||||
test_paint_rect ()
|
test_paint_rect ()
|
||||||
{
|
{
|
||||||
cogl_path_rectangle (-50, -25, 100, 50);
|
cogl_path_rectangle (-50, -25, 50, 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_paint_rndrect()
|
test_paint_rndrect()
|
||||||
{
|
{
|
||||||
cogl_path_round_rectangle (-50, -25, 100, 50, 10, 5);
|
cogl_path_round_rectangle (-50, -25, 50, 25, 10, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user