Open Harbs opened 10 years ago
I'm seeing different behavior. If two cells have a stroke the last one set overlaps the one next to it. I wasn't able to find a stroke location property. Do you have an INDD file showing what you are talking about or steps to reproduce?
Sorry I was not clear.
InDesign does work differently. A cell stroke is halfway inside the cell, and halfway outside it. Each cell has stroke priorities to determine which stroke wins when there's a conflict.
In InDesign, if cell 1 has a 2 point stroke and cell 2 has a 2 point stroke, a single 2 point stroke will be drawn between the two cells, and the higher priority wins.
I'm proposing a different model. If cell one has a 2 pixel stroke and cell 2 has a 2 pixel stroke, BOTH strokes will be drawn side by side, so there's no conflict. It would be a bit of work converting between the InDesign model, and this one, but I think this is a more flexible model (cell spacing would have meaning), and requires less overhead tracking conflicts.
The problem with this model however, is how to handle edge cells. We need to draw half the stroke outside the cell bounds.
Possible solutions (copied here for posterity)
Option 1 - Only allow strokes to grow on the inside of the cell or clip the content. For example, Photoshop has a stroke position that accepts centered (default for InDesign) or inside or outside.
Example at 1pt: Example at 4pts:
Option 2 - Stroke overlap. When two edges compete draw the edges of both cells. In the following case the 4pt blue border of the first cell conflicts with the 1pt magenta border of the next cell.
In conflicting edges of different weights draw both cell edges.
Currently, cell strokes are drawn within the cell bounds. If you have a cell which has a 1 pixel stroke, and the next cell also has a 1 pixel stoke, you will get a two pixel stroke between the two. This works well for strokes inside a table. The question remains, how to handle outside strokes. In that case, we need a method to draw a stroke outside the bounds of the cell.
Take a look at InDesign to see how things work there.
I currently have two ideas: 1) To figure out if a specific stroke is an external one, and draw it halfway outside the bounds if yes. 2) To add an "externalStrokeWidth" property which would be drawn if the stroke is an outside border of the table.
Any other ideas?