@@ -713,6 +713,8 @@ M.draw_quad = function(corners, target_position, vertical_bar)
713713 bulge_above = not bulge_above
714714 corners = ensure_clockwise (corners )
715715 local G = precompute_quad_geometry (corners )
716+ local min_shade_no_diagonal = vertical_bar and config .min_shade_no_diagonal_vertical_bar
717+ or config .min_shade_no_diagonal
716718
717719 for row = G .top , G .bottom do
718720 for col = G .left , G .right do
@@ -732,18 +734,22 @@ M.draw_quad = function(corners, target_position, vertical_bar)
732734 for i = 1 , 4 do
733735 local intersection = get_edge_cell_intersection (i , row , col , G )
734736 local edge_type = G .edge_types [i ]
735- if edge_type == LEFT_DIAGONAL or edge_type == RIGHT_DIAGONAL then edge_type = DIAGONAL end
736- if edge_type ~= DIAGONAL and intersection >= 1 then goto continue end
737737
738- if edge_type == DIAGONAL then
738+ if edge_type == LEFT_DIAGONAL or edge_type == RIGHT_DIAGONAL then
739+ edge_type = DIAGONAL
739740 local intersection_low = get_edge_cell_intersection (i , row , col , G , true )
740741 if intersection_low >= 1 then goto continue end
741- -- if intersections[DIAGONAL] ~= nil and intersection > 0 then single_diagonal = false end
742+ if intersection > min_shade_no_diagonal and intersections [DIAGONAL ] ~= nil then
743+ single_diagonal = false
744+ end
742745 else
743- if intersection > 0 then single_diagonal = false end
746+ if intersection >= 1 then goto continue end
747+ if intersection > min_shade_no_diagonal then single_diagonal = false end
744748 end
745749
746- if intersections [edge_type ] == nil or intersection > intersections [edge_type ] then
750+ if
751+ intersection > 0 and (intersections [edge_type ] == nil or intersection > intersections [edge_type ])
752+ then
747753 intersections [edge_type ] = intersection
748754 if edge_type == DIAGONAL then diagonal_edge_index = i end
749755 end
0 commit comments