Commit 8cabdbe5 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/gimpviewrendererbrush.c use gimp_viewable_get_size() and get

2006-05-10  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpviewrendererbrush.c
	* app/widgets/gimpviewrendererbuffer.c: use
	gimp_viewable_get_size() and get rid of useless
	local "brush" and "buffer" variables.
parent bca167a5
2006-05-10 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpviewrendererbrush.c
* app/widgets/gimpviewrendererbuffer.c: use
gimp_viewable_get_size() and get rid of useless
local "brush" and "buffer" variables.
2006-05-10 Michael Natterer <mitch@gimp.org> 2006-05-10 Michael Natterer <mitch@gimp.org>
* app/widgets/gimptoolbox.c: code cleanup, no logic changed. * app/widgets/gimptoolbox.c: code cleanup, no logic changed.
......
...@@ -84,7 +84,6 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer, ...@@ -84,7 +84,6 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
GtkWidget *widget) GtkWidget *widget)
{ {
GimpViewRendererBrush *renderbrush = GIMP_VIEW_RENDERER_BRUSH (renderer); GimpViewRendererBrush *renderbrush = GIMP_VIEW_RENDERER_BRUSH (renderer);
GimpBrush *brush;
TempBuf *temp_buf; TempBuf *temp_buf;
gint brush_width; gint brush_width;
gint brush_height; gint brush_height;
...@@ -95,9 +94,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer, ...@@ -95,9 +94,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
renderbrush->pipe_timeout_id = 0; renderbrush->pipe_timeout_id = 0;
} }
brush = GIMP_BRUSH (renderer->viewable); gimp_viewable_get_size (renderer->viewable, &brush_width, &brush_height);
brush_width = brush->mask->width;
brush_height = brush->mask->height;
temp_buf = gimp_viewable_get_new_preview (renderer->viewable, temp_buf = gimp_viewable_get_new_preview (renderer->viewable,
renderer->width, renderer->width,
...@@ -117,7 +114,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer, ...@@ -117,7 +114,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
temp_buf_free (temp_buf); temp_buf_free (temp_buf);
if (GIMP_IS_BRUSH_PIPE (brush)) if (GIMP_IS_BRUSH_PIPE (renderer->viewable))
{ {
renderbrush->pipe_animation_index = 0; renderbrush->pipe_animation_index = 0;
renderbrush->pipe_timeout_id = renderbrush->pipe_timeout_id =
...@@ -139,10 +136,10 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer, ...@@ -139,10 +136,10 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
if (renderer->width >= INDICATOR_WIDTH * 2 && if (renderer->width >= INDICATOR_WIDTH * 2 &&
renderer->height >= INDICATOR_HEIGHT * 2 && renderer->height >= INDICATOR_HEIGHT * 2 &&
(renderer->width < brush_width || (renderer->width < brush_width ||
renderer->height < brush_height || renderer->height < brush_height ||
GIMP_IS_BRUSH_PIPE (brush) || GIMP_IS_BRUSH_PIPE (renderer->viewable) ||
GIMP_IS_BRUSH_GENERATED (brush))) GIMP_IS_BRUSH_GENERATED (renderer->viewable)))
{ {
#define WHT { 255, 255, 255 } #define WHT { 255, 255, 255 }
#define BLK { 0, 0, 0 } #define BLK { 0, 0, 0 }
...@@ -225,8 +222,8 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer, ...@@ -225,8 +222,8 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
buf = renderer->buffer + (offset_y * renderer->rowstride + buf = renderer->buffer + (offset_y * renderer->rowstride +
offset_x * renderer->bytes); offset_x * renderer->bytes);
pipe = GIMP_IS_BRUSH_PIPE (brush); pipe = GIMP_IS_BRUSH_PIPE (renderer->viewable);
genbrush = GIMP_IS_BRUSH_GENERATED (brush); genbrush = GIMP_IS_BRUSH_GENERATED (renderer->viewable);
scale = (renderer->width < brush_width || scale = (renderer->width < brush_width ||
renderer->height < brush_height); renderer->height < brush_height);
alpha = (renderer->bytes == 4); alpha = (renderer->bytes == 4);
......
...@@ -61,16 +61,17 @@ static void ...@@ -61,16 +61,17 @@ static void
gimp_view_renderer_buffer_render (GimpViewRenderer *renderer, gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
GtkWidget *widget) GtkWidget *widget)
{ {
GimpBuffer *buffer; gint buffer_width;
gint view_width; gint buffer_height;
gint view_height; gint view_width;
gboolean scaling_up; gint view_height;
TempBuf *render_buf = NULL; gboolean scaling_up;
TempBuf *render_buf = NULL;
buffer = GIMP_BUFFER (renderer->viewable); gimp_viewable_get_size (renderer->viewable, &buffer_width, &buffer_height);
gimp_viewable_calc_preview_size (gimp_buffer_get_width (buffer), gimp_viewable_calc_preview_size (buffer_width,
gimp_buffer_get_height (buffer), buffer_height,
renderer->width, renderer->width,
renderer->height, renderer->height,
TRUE, 1.0, 1.0, TRUE, 1.0, 1.0,
...@@ -83,8 +84,7 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer, ...@@ -83,8 +84,7 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
TempBuf *temp_buf; TempBuf *temp_buf;
temp_buf = gimp_viewable_get_new_preview (renderer->viewable, temp_buf = gimp_viewable_get_new_preview (renderer->viewable,
gimp_buffer_get_width (buffer), buffer_width, buffer_height);
gimp_buffer_get_height (buffer));
if (temp_buf) if (temp_buf)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment