Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Librem5
squeekboard
Commits
38b226b4
Commit
38b226b4
authored
Mar 03, 2011
by
Daiki Ueno
Browse files
Clear allocation box when drawing keyboard.
parent
c53b4d39
Changes
1
Hide whitespace changes
Inline
Side-by-side
eek/eek-renderer.c
View file @
38b226b4
...
...
@@ -49,7 +49,10 @@ struct _EekRendererPrivate
EekColor
*
background
;
gdouble
border_width
;
gdouble
allocation_width
;
gdouble
allocation_height
;
gdouble
scale
;
PangoFontDescription
*
font
;
GHashTable
*
outline_surface_cache
;
cairo_surface_t
*
keyboard_surface
;
...
...
@@ -533,9 +536,26 @@ eek_renderer_real_render_keyboard (EekRenderer *self,
{
EekRendererPrivate
*
priv
=
EEK_RENDERER_GET_PRIVATE
(
self
);
g_return_if_fail
(
priv
->
keyboard
);
g_return_if_fail
(
priv
->
allocation_width
>
0
.
0
);
g_return_if_fail
(
priv
->
allocation_height
>
0
.
0
);
if
(
!
priv
->
keyboard_surface
)
priv
->
keyboard_surface
=
create_keyboard_surface
(
self
);
/* blank background */
cairo_set_source_rgba
(
cr
,
priv
->
background
->
red
,
priv
->
background
->
green
,
priv
->
background
->
blue
,
priv
->
background
->
alpha
);
cairo_rectangle
(
cr
,
0
.
0
,
0
.
0
,
priv
->
allocation_width
,
priv
->
allocation_height
);
cairo_fill
(
cr
);
cairo_set_source_surface
(
cr
,
priv
->
keyboard_surface
,
0
.
0
,
0
.
0
);
cairo_paint
(
cr
);
}
...
...
@@ -674,6 +694,8 @@ eek_renderer_init (EekRenderer *self)
priv
->
foreground
=
eek_color_new
(
0
.
3
,
0
.
3
,
0
.
3
,
1
.
0
);
priv
->
background
=
eek_color_new
(
1
.
0
,
1
.
0
,
1
.
0
,
1
.
0
);
priv
->
border_width
=
1
.
0
;
priv
->
allocation_width
=
0
.
0
;
priv
->
allocation_height
=
0
.
0
;
priv
->
scale
=
1
.
0
;
priv
->
font
=
NULL
;
priv
->
outline_surface_cache
=
...
...
@@ -737,6 +759,9 @@ eek_renderer_set_allocation_size (EekRenderer *renderer,
priv
=
EEK_RENDERER_GET_PRIVATE
(
renderer
);
priv
->
allocation_width
=
width
;
priv
->
allocation_height
=
height
;
eek_element_get_bounds
(
EEK_ELEMENT
(
priv
->
keyboard
),
&
bounds
);
scale
=
width
>
height
?
height
/
bounds
.
height
:
width
/
bounds
.
width
;
...
...
Write
Preview
Markdown
is supported
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