[gtk+] glarea: Use content size of the widget
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] glarea: Use content size of the widget
- Date: Fri, 3 Nov 2017 09:47:47 +0000 (UTC)
commit 4f4ac29cd2c850c7331c71827ed3b346ceafa543
Author: Timm Bäder <mail baedert org>
Date: Fri Nov 3 10:44:16 2017 +0100
glarea: Use content size of the widget
For buffer sizes, etc. We only draw in the content area after all.
gtk/gtkglarea.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 5cbbe5e..27157a0 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -433,8 +433,8 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area)
return;
scale = gtk_widget_get_scale_factor (widget);
- width = gtk_widget_get_allocated_width (widget) * scale;
- height = gtk_widget_get_allocated_height (widget) * scale;
+ width = gtk_widget_get_width (widget) * scale;
+ height = gtk_widget_get_height (widget) * scale;
if (priv->texture)
{
@@ -632,8 +632,8 @@ gtk_gl_area_draw (GtkWidget *widget,
{
gtk_gl_area_draw_error_screen (area,
cr,
- gtk_widget_get_allocated_width (widget),
- gtk_widget_get_allocated_height (widget));
+ gtk_widget_get_width (widget),
+ gtk_widget_get_height (widget));
return FALSE;
}
@@ -650,8 +650,8 @@ gtk_gl_area_draw (GtkWidget *widget,
glDisable (GL_DEPTH_TEST);
scale = gtk_widget_get_scale_factor (widget);
- w = gtk_widget_get_allocated_width (widget) * scale;
- h = gtk_widget_get_allocated_height (widget) * scale;
+ w = gtk_widget_get_width (widget) * scale;
+ h = gtk_widget_get_height (widget) * scale;
status = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
if (status == GL_FRAMEBUFFER_COMPLETE_EXT)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]