Bug 366495 - Image in preview window and output PDFs clipped in Kubuntu 16.04 and Mint 18
Summary: Image in preview window and output PDFs clipped in Kubuntu 16.04 and Mint 18
Status: RESOLVED WORKSFORME
Alias: None
Product: cirkuit
Classification: Applications
Component: general (show other bugs)
Version: 0.4.3
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: Matteo Agostinelli
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-07 15:49 UTC by Andrew
Modified: 2022-11-26 05:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2016-08-07 15:49:59 UTC
Circuits (m4 files) that were shown perfectly in the preview window in Mint 17 are now clipped (surrounded by white space up to the edges of the window). The output PDFs are also clipped. Used Cirkuit 0.4.3, Tex etc. installed from Ubuntu website. Texlive version shown as 2015.21060320-1.

It would be appreciated if this incredibly useful program could be fixed.


Reproducible: Always

Steps to Reproduce:
1. Open valves.m4 file
2. Preview
3. Save PDF and open it.

Actual Results:  
Image clipped in viewer so not all the text can be seen. I.e. boundary around image not set correctly.
PDF image also clipped.


% Example file valves.m4 below:
% valves.m4
.PS                            # Pic input begins with .PS
cct_init                       # Set defaults
linethick_(1.0)

elen = 1.0                   # Variables are allowed; default units are inches
Origin: Here                   # Position names are capitalized

move to 0.0, 0.0
line down_ elen*0.0
dot
{
     circle radius elen*0.5
}
{
     line down_ elen*0.2
     move left_ elen*0.2
     line right_ elen*0.4
}
  move down_ elen*0.5
  move left_ elen*0.5


{
  move down_ elen*0.35
  move right_ elen*0.15
X:  dot

  line to X.x+0.1, X.y+0.1
  line right_ elen*0.5
U: Here
  line to U.x+0.05, U.y-0.05

}
  move down_ elen*0.45
  move right elen*0.3
H1: dot
  move right elen*0.4
H2: dot
  arc cw from H1 to H2 radius elen*0.21

"Anode" at (elen*0.0, elen*0.15)
#"Grid" at (-elen*0.75, -elen*0.5)
"Cathode" at (-elen*0.7, -elen*0.85)
"Heater" at (-elen*0.0, -elen*1.15)
"\large Diode" at (elen*0.0, -elen*1.5)
"\large Triode" at (elen*1.5, -elen*1.5)
"\large Pentode" at (elen*3.0, -elen*1.5)

move to 1.5, 0.0
line down_ elen*0.0
dot
{
     circle radius elen*0.5
}
{
     line down_ elen*0.2
     move left_ elen*0.2
     line right_ elen*0.4
}
  move down_ elen*0.5
  move left_ elen*0.5
G: dot

{
    line right_ elen*0.9 dashed
}
{
  move down_ elen*0.35
  move right_ elen*0.15
X:  dot

  line to X.x+0.1, X.y+0.1
  line right_ elen*0.5
U: Here
  line to U.x+0.05, U.y-0.05

}
  move down_ elen*0.45
  move right elen*0.3
H1: dot
  move right elen*0.4
H2: dot
  arc cw from H1 to H2 radius elen*0.21

"Grid" at (elen*0.8, -elen*0.5)

move to 3.0, 0.0
line down_ elen*0.0
dot
{
     circle radius elen*0.5
}
{
     line down_ elen*0.2
     move left_ elen*0.2
     line right_ elen*0.4
}
  move down_ elen*0.5
  move left_ elen*0.5


{
    dot
    line right_ elen*0.9 dashed
}
{
    move up_ elen*0.1
    move right_ elen*0.015
    dot
    line right_ elen*0.9 dashed
}
{
    move down_ elen*0.1
    move right_ elen*0.015
    dot
    line right_ elen*0.9 dashed
}
{
  move down_ elen*0.35
  move right_ elen*0.15
X:  dot

  line to X.x+0.1, X.y+0.1
  line right_ elen*0.5
U: Here
  line to U.x+0.05, U.y-0.05

}
  move down_ elen*0.45
  move right elen*0.3
H1: dot
  move right elen*0.4
H2: dot
  arc cw from H1 to H2 radius elen*0.21

.PE                            # Pic input ends
Comment 1 Andrew 2016-11-12 17:46:29 UTC
To fix patch src/lib/generator.cpp (replace lines 160-175 with that below). Note epstool must be installed on your system.

    if (in == Format::Dvi) {
        if (out == Format::Postscript) {
            QStringList args;
            args << formatPath(in) << "-q" << QString("-o %1").arg(formatPath(Format::Postscript));
            return execute(new Command("dvips", "", args, this));
        } else if (out == Format::Eps) {
            QStringList args;
            QString tmpfile = (d->tempFileInfo->baseName()) + QString::fromAscii("-tmp");
            args << "-E" << formatPath(in) << "-q" << "-o" << tmpfile.arg(formatPath(Format::Eps));
            execute(new Command("dvips", "", args, this));
            args.clear();
            args << "--bbox"  << "--copy" << "--output" << formatPath(Format::Eps) << tmpfile.arg(formatPath(Format::Eps));
            return execute(new Command("epstool", "", args, this));

        } else {
            bool b = true;
            if (!convert(in,Format::Eps)) b = false;
            if (!convert(Format::Eps,out)) b = false;
            return b;
        }
    }
Comment 2 Justin Zobel 2022-10-27 02:48:54 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 3 Bug Janitor Service 2022-11-11 05:18:20 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2022-11-26 05:15:59 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!