表格边框优化
This commit is contained in:
@@ -28,16 +28,29 @@ end;
|
||||
function TSPdfBordersRange.Do();override;
|
||||
begin
|
||||
// println("Left = {}, Top = {}, Right = {}, Bottom = {}, Tl2Br = {}, Tr2Bl = {}", Left, Top, Right, Bottom, Tl2Br, Tr2Bl);
|
||||
borders := {self.}TcPr.TcBorders;
|
||||
if {self.}TcPr.Shd.Fill and {self.}TcPr.Shd.Fill <> "auto" then
|
||||
begin
|
||||
[r, g, b] := TSColorToolKit.HexToRGB({self.}TcPr.Shd.Fill);
|
||||
{self.}TSPage.PdfPage.SetRGBFill(r/255, g/255, b/255);
|
||||
{self.}TSPage.PdfPage.Rectangle({self.}EndX, {self.}EndY - {self.}DynamicHeight, {self.}Width, {self.}DynamicHeight);
|
||||
x := {self.}EndX;
|
||||
y := {self.}EndY - {self.}DynamicHeight;
|
||||
w := {self.}Width;
|
||||
h := {self.}DynamicHeight;
|
||||
tmp := borders.Left.Sz ? borders.Left.Sz / 2 : 0.25;
|
||||
x += tmp;
|
||||
w -= tmp;
|
||||
w -= borders.Right.Sz ? borders.Right.Sz / 2 : 0.25;
|
||||
tmp := borders.Bottom.Sz ? borders.Bottom.Sz / 2 : 0.25;
|
||||
y += tmp;
|
||||
h -= tmp;
|
||||
h -= borders.Top.Sz ? borders.Top.Sz / 2 : 0.25;
|
||||
|
||||
{self.}TSPage.PdfPage.Rectangle(x, y, w, h);
|
||||
{self.}TSPage.PdfPage.Fill();
|
||||
{self.}TSPage.PdfPage.SetRGBFill(0, 0, 0);
|
||||
{self.}Left := true;
|
||||
end
|
||||
borders := {self.}TcPr.TcBorders;
|
||||
if {self.}Left then
|
||||
{self.}DrawLine(borders.Left, {self.}EndX, {self.}EndY, {self.}EndX, {self.}EndY - {self.}DynamicHeight);
|
||||
if {self.}Top then
|
||||
|
||||
Reference in New Issue
Block a user