Skip to content

Fix PS backend#21840

Open
couet wants to merge 6 commits intomasterfrom
ps-fix2
Open

Fix PS backend#21840
couet wants to merge 6 commits intomasterfrom
ps-fix2

Conversation

@couet
Copy link
Copy Markdown
Member

@couet couet commented Apr 8, 2026

In TPostScript (like in TPDF) the color should be set in the file only when something painted.

The previous version of TPostScript set the color to many times and the following macro produced a very large file:

void large_ps()
{
    auto c1 = new TCanvas("c1","c1",500,500);
    auto box = new TBox(0.1,0.1,0.9,0.9);
    box->SetFillColor(kYellow);
    box->SetFillStyle(1001);
    c1->Add(box);

    TPostScript ps1("large.ps");

    for (int n = 0; n < 1000000; ++n) {
       gVirtualPS->SetFillColor(kRed);
       gVirtualPS->SetLineColor(kGreen);
    }
    c1->Draw();
    ps1.Close();
}

@couet couet requested a review from dpiparo as a code owner April 8, 2026 13:04
@couet couet requested review from linev and removed request for dpiparo April 8, 2026 13:04
@couet couet self-assigned this Apr 8, 2026
@linev
Copy link
Copy Markdown
Member

linev commented Apr 8, 2026

There are still many tests in stressGraphics failing.

I recommend fix also TPostScript::SetLineWidth() and TPostScript::SetLineStyle() and then adjust stressGraphics.ref files. Otherwise one need do same job twice.

@couet
Copy link
Copy Markdown
Member Author

couet commented Apr 8, 2026

I know...

@couet
Copy link
Copy Markdown
Member Author

couet commented Apr 8, 2026

First I will make sure the ref file are ok with colors.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Test Results

    22 files      22 suites   3d 1h 10m 32s ⏱️
 3 833 tests  3 832 ✅  1 💤 0 ❌
75 653 runs  75 635 ✅ 18 💤 0 ❌

Results for commit ef7caa4.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Member

@linev linev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All relevant tests pass so one can merge PR

@linev linev changed the title Fif PS backend Fix PS backend Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants