GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

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>
* app/widgets/gimptoolbox.c: code cleanup, no logic changed.
......
......@@ -84,7 +84,6 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
GtkWidget *widget)
{
GimpViewRendererBrush *renderbrush = GIMP_VIEW_RENDERER_BRUSH (renderer);
GimpBrush *brush;
TempBuf *temp_buf;
gint brush_width;
gint brush_height;
......@@ -95,9 +94,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
renderbrush->pipe_timeout_id = 0;
}
brush = GIMP_BRUSH (renderer->viewable);
brush_width = brush->mask->width;
brush_height = brush->mask->height;
gimp_viewable_get_size (renderer->viewable, &brush_width, &brush_height);
temp_buf = gimp_viewable_get_new_preview (renderer->viewable,
renderer->width,
......@@ -117,7 +114,7 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
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_timeout_id =
......@@ -139,10 +136,10 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
if (renderer->width >= INDICATOR_WIDTH * 2 &&
renderer->height >= INDICATOR_HEIGHT * 2 &&
(renderer->width < brush_width ||
renderer->height < brush_height ||
GIMP_IS_BRUSH_PIPE (brush) ||
GIMP_IS_BRUSH_GENERATED (brush)))
(renderer->width < brush_width ||
renderer->height < brush_height ||
GIMP_IS_BRUSH_PIPE (renderer->viewable) ||
GIMP_IS_BRUSH_GENERATED (renderer->viewable)))
{
#define WHT { 255, 255, 255 }
#define BLK { 0, 0, 0 }
......@@ -225,8 +222,8 @@ gimp_view_renderer_brush_render (GimpViewRenderer *renderer,
buf = renderer->buffer + (offset_y * renderer->rowstride +
offset_x * renderer->bytes);
pipe = GIMP_IS_BRUSH_PIPE (brush);
genbrush = GIMP_IS_BRUSH_GENERATED (brush);
pipe = GIMP_IS_BRUSH_PIPE (renderer->viewable);
genbrush = GIMP_IS_BRUSH_GENERATED (renderer->viewable);
scale = (renderer->width < brush_width ||
renderer->height < brush_height);
alpha = (renderer->bytes == 4);
......
......@@ -61,16 +61,17 @@ static void
gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
GtkWidget *widget)
{
GimpBuffer *buffer;
gint view_width;
gint view_height;
gboolean scaling_up;
TempBuf *render_buf = NULL;
gint buffer_width;
gint buffer_height;
gint view_width;
gint view_height;
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_buffer_get_height (buffer),
gimp_viewable_calc_preview_size (buffer_width,
buffer_height,
renderer->width,
renderer->height,
TRUE, 1.0, 1.0,
......@@ -83,8 +84,7 @@ gimp_view_renderer_buffer_render (GimpViewRenderer *renderer,
TempBuf *temp_buf;
temp_buf = gimp_viewable_get_new_preview (renderer->viewable,
gimp_buffer_get_width (buffer),
gimp_buffer_get_height (buffer));
buffer_width, buffer_height);
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