ObjectProfile / Roassal3

The Roassal Visualization Engine
MIT License
97 stars 52 forks source link

Exporting to SVG using the SVG Cairo exporter is broken. #522

Closed massimo-nocentini closed 1 year ago

massimo-nocentini commented 1 year ago

I'm writing from an Ubuntu (22.04 LTS) box and I'm trying to isolate an example about the exporting to SVG files using the Cairo SVG exporter: The problem that I've found is that the latest master branch yields a wrong exporting. The following steps can be used to reproduce my problem:

  1. Get a fresh image and the vm with curl https://get.pharo.org/64/110+vm | bash;
  2. then open it with ./pharo-ui, open a Playground and evaluate the following code:

    Metacello new
    baseline: 'Roassal3Exporters';
    repository: 'github://ObjectProfile/Roassal3Exporters';
    load.
    
          pango := (RSLabel new
                        text: 'hello world';
                        yourself) .
    
          another := (RSLabel new
                          size: 14;
                          text: 'Mickey Mouse';
                          yourself).
    
          RSLocation new above move: pango on: another.
    
          c := RSComposite new
                   shapes: (RSGroup new
                            add: pango;
                            add: another;
                            yourself);
                   "translateTo: 100 asPoint;"yourself.
    canvas := RSCanvas new.
          canvas add: c.
    
        canvas svgCairoExporter zoomToShapes ;export.

    that should produce a good SVG image

3858745080738774

with the two small labels.

  1. evaluate then the following chunk that loads the latest master branch:
    [Metacello new
    baseline: 'Roassal3';
    repository: 'github://ObjectProfile/Roassal3';
    load: 'Full' ] on: MCMergeOrLoadWarning do: [:warning | warning load ].
  2. then re-evaluate the chunks:

    pango := (RSLabel new
                        text: 'hello world';
                        yourself) .
    
          another := (RSLabel new
                          size: 14;
                          text: 'Michey Mouse';
                          yourself).
    
          RSLocation new above move: pango on: another.
    
          c := RSComposite new
                   shapes: (RSGroup new
                            add: pango;
                            add: another;
                            yourself);
                   "translateTo: 100 asPoint;"yourself.
    canvas := RSCanvas new.
          canvas add: c.
    
        canvas svgCairoExporter zoomToShapes ;export.

    which produces a wrong image on my machine

3858745190725648

akevalion commented 1 year ago

Thanks maybe this issue is for https://github.com/ObjectProfile/Roassal3Exporters

akevalion commented 1 year ago

Is fixed after this pull request https://github.com/ObjectProfile/Roassal3Exporters/pull/37