app: some random code cleanup

This commit is contained in:
Michael Natterer 2014-06-02 20:17:39 +02:00
parent 8836127efb
commit 069996d75f
3 changed files with 29 additions and 24 deletions

View File

@ -132,7 +132,7 @@ static void simplify_subdivide (const GimpBoundSeg *segs,
/**
* gimp_boundary_find:
* @maskPR: any PixelRegion
* @buffer: a #GeglBuffer
* @format: a #Babl float format representing the component to analyze
* @type: type of bounds
* @x1: left side of bounds
@ -225,7 +225,9 @@ gimp_boundary_sort (const GimpBoundSeg *segs,
if (num_segs == 0)
return NULL;
/* prepare arrays with GimpBoundSeg pointers sorted by xy1 and xy2 accordingly */
/* prepare arrays with GimpBoundSeg pointers sorted by xy1 and xy2
* accordingly
*/
segs_ptrs_by_xy1 = g_new (const GimpBoundSeg *, num_segs);
segs_ptrs_by_xy2 = g_new (const GimpBoundSeg *, num_segs);
@ -387,6 +389,9 @@ gimp_boundary_offset (GimpBoundSeg *segs,
{
gint i;
g_return_if_fail ((segs == NULL && num_segs == 0) ||
(segs != NULL && num_segs > 0));
for (i = 0; i < num_segs; i++)
{
/* dont offset sorting sentinels */

View File

@ -247,10 +247,11 @@ gimp_scan_convert_stroke (GimpScanConvert *sc,
GArray *dash_info)
{
sc->do_stroke = TRUE;
sc->width = width;
sc->join = join;
sc->cap = cap;
sc->miter = miter;
sc->width = width;
sc->join = join;
sc->cap = cap;
sc->miter = miter;
if (sc->dash_info)
{
g_array_free (sc->dash_info, TRUE);

View File

@ -343,7 +343,7 @@ gimp_region_select_tool_calculate (GimpRegionSelectTool *region_sel,
gint *n_segs)
{
GimpDisplayShell *shell = gimp_display_get_shell (display);
GimpBoundSeg *segs;
GimpBoundSeg *segs = NULL;
gimp_display_shell_set_override_cursor (shell, GDK_WATCH);
@ -354,25 +354,24 @@ gimp_region_select_tool_calculate (GimpRegionSelectTool *region_sel,
GIMP_REGION_SELECT_TOOL_GET_CLASS (region_sel)->get_mask (region_sel,
display);
if (! region_sel->region_mask)
if (region_sel->region_mask)
{
gimp_display_shell_unset_override_cursor (shell);
*n_segs = 0;
return NULL;
/* calculate and allocate a new segment array which represents
* the boundary of the contiguous region
*/
segs = gimp_boundary_find (region_sel->region_mask, NULL,
babl_format ("Y float"),
GIMP_BOUNDARY_WITHIN_BOUNDS,
0, 0,
gegl_buffer_get_width (region_sel->region_mask),
gegl_buffer_get_height (region_sel->region_mask),
GIMP_BOUNDARY_HALF_WAY,
n_segs);
}
else
{
*n_segs = 0;
}
/* calculate and allocate a new segment array which represents the
* boundary of the contiguous region
*/
segs = gimp_boundary_find (region_sel->region_mask, NULL,
babl_format ("Y float"),
GIMP_BOUNDARY_WITHIN_BOUNDS,
0, 0,
gegl_buffer_get_width (region_sel->region_mask),
gegl_buffer_get_height (region_sel->region_mask),
GIMP_BOUNDARY_HALF_WAY,
n_segs);
gimp_display_shell_unset_override_cursor (shell);