Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
squeekboard
Commits
5266c621
Commit
5266c621
authored
Dec 01, 2019
by
Dorota Czaplejewicz
Browse files
renderer: Simplified outline rendering
parent
4ee832c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
eek/eek-renderer.c
View file @
5266c621
...
...
@@ -195,35 +195,12 @@ static void render_button_in_context(EekRenderer *self,
GtkStyleContext
*
ctx
,
struct
button_place
*
place
,
gboolean
active
)
{
cairo_surface_t
*
outline_surface
=
NULL
;
/* blank background */
cairo_set_source_rgba
(
cr
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
cairo_paint
(
cr
);
/* render outline */
EekBounds
bounds
=
squeek_button_get_bounds
(
place
->
button
);
{
cairo_t
*
cr
;
// Outline will be drawn on the outside of the button, so the
// surface needs to be bigger than the button
outline_surface
=
cairo_image_surface_create
(
CAIRO_FORMAT_ARGB32
,
(
int
)
ceil
(
bounds
.
width
)
+
10
,
(
int
)
ceil
(
bounds
.
height
)
+
10
);
cr
=
cairo_create
(
outline_surface
);
/* blank background */
cairo_set_source_rgba
(
cr
,
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
cairo_paint
(
cr
);
cairo_save
(
cr
);
eek_renderer_apply_transformation_for_button
(
cr
,
place
,
1
.
0
,
FALSE
);
render_outline
(
cr
,
ctx
,
bounds
);
cairo_restore
(
cr
);
cairo_destroy
(
cr
);
}
cairo_set_source_surface
(
cr
,
outline_surface
,
0
.
0
,
0
.
0
);
cairo_surface_destroy
(
outline_surface
);
render_outline
(
cr
,
ctx
,
bounds
);
cairo_paint
(
cr
);
/* render icon (if any) */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment