Code Duplication    Length = 5-5 lines in 2 locations

main/inc/lib/geometry.lib.php 2 locations

@@ 158-162 (lines=5) @@
155
//                ')-pente'.$pente;
156
157
        // doubling the first point if needed (see above)
158
        if (($pente1 < 0 && $pente > 0) || ($pente1 > 0 && $pente < 0)) {
159
            if (is_array($bords[$poly[$i - 1]['y']]))
160
                array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
161
            //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
162
        }
163
        //  doubling the last point if neededd
164
        if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) {
165
            if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning
@@ 164-168 (lines=5) @@
161
            //if (DEBUG) echo '('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
162
        }
163
        //  doubling the last point if neededd
164
        if (($old_pente < 0 && $pente > 0) || ($old_pente > 0 && $pente < 0)) {
165
            if (is_array($bords[$poly[$i - 1]['y']])) //avoid warning
166
                array_push($bords[$poly[$i - 1]['y']], round($poly[$i - 1]['x']));
167
            //if (DEBUG) echo '*('.$poly[$i-1]['x'].';'.$poly[$i-1]['y'].')   ';
168
        }
169
170
171
        $dy_inc = ($poly[0]['y'] - $poly[$i - 1]['y']) > 0 ? 1 : -1;