Roassal: Adjusting to fixed canvas size
by Hernán Morales Durand
Hi guys,
Using Pharo 6.1/Win here.
Is there any way to adjust a RTView canvas to a fixed size, say 620 x
744 px, before the elements gets added into the view?
This is what I've tried so far:
1) Empty canvas manually set to 620 x 744 px produces 1x1 image:
| view |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
(RTCanvasExporter canvas: view canvas)
format: #png;
fileName: 'test_empty.png';
export.
2) Non-empty canvas manually set to 620 x 744 px produces 25x15 image:
| view elems |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
elems := (RTBox new color: Color blue) elementsOn: (1 to: 5).
view addAll: elems.
RTGridLayout on: view elements.
(RTCanvasExporter canvas: view canvas)
format: #png;
fileName: 'test_5elems.png';
export.
3) Idem 2) adding #scale: 10 -> 250x150px ... #scale: 24.8 -> 620 px
| view elems |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
elems := (RTBox new color: Color blue) elementsOn: (1 to: 5).
view addAll: elems.
RTGridLayout on: view elements.
(RTCanvasExporter canvas: view canvas)
format: #png;
scale: 12.4;
fileName: 'test_5elems_scaled.png';
export.
4) Adding #oversizedBy: to 3) finally makes the trick:
| view elems |
view := RTView new
setCanvas: (TRCanvas new extent: 620 @ 744; yourself);
yourself.
elems := (RTBox new color: Color blue) elementsOn: (1 to: 5).
view addAll: elems.
RTGridLayout on: view elements.
(RTCanvasExporter canvas: view canvas)
format: #png;
scale: 24.8;
oversizedBy: 0 @ 15;
fileName: 'test_5elems_scale2_osized.png';
export.
- So setting manually canvas extent doesn't have any effect?
- Any way also to set a fixed margin or padding size (distance between
image element and border)?
Cheers,
Hernán
4 years, 5 months
PetitParser release: v2.1.0
by Julien
Hello,
This email to announce that a new minor release of PetitParser (1) has been published on GitHub (v2.1.0).
Here is the change log:
Summary
-----------
- Each package has its tests separated in a separated package.
- Cleaned baseline, made it more modular.
- Created more groups to let people load the part of the project they want.
- Some cleaning in `PetitParser` package.
- Integrated PetitPreprocessor and PetitParserExtensions in the project as separated groups
Changelog
-----------
#31 Extract PPTextHighlighter into a separated package.
#21 Add contribution guidelines
#13 Update README with new groups
#9 Fix CI configuration
#19 A TODO comment in PPMemoizedParser>>#parseOn: might need to be fixed cleaning
#11 Inconsistent method classification
#15 Split tests in their own packages cleaning
#22 PetitPreprocessor is missing some extensions
#3 Use `>>>` notation for examples inside method
#8 PPStream>>#column: has commented code that should be removed
#7 PPCharSetPredicate and PPContextMemento need to be commented
#1 Replace 'Oops' error message with a meaningful message
#4 PPContext>>#on:stream: should be removed
#2 Integrate PetitParserExtensions package from Smalltalkhub
#5 Integrate PetitPreprocessor package from Smalltalkhub
Thanks to Cyril Ferlicot for his help.
Cheers,
Julien
---
Julien Delplanque
Doctorant à l’Université de Lille
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, Avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40
4 years, 5 months
Help: how to follow Parameters
by Erik Stel
Through a jdt2famix parsed model of an application I'm trying to follow the
usage of a (FAMIX)Parameter. How can this be done?
>From a method parameter I can access its enclosing method and from there on
find invocations within that method for example. The problem is that there
does not seem to be a direct way to retrieve the fact that a parameter is
part of a method invocation (both direct or as part of an expression). It
seems I have to parse a piece of the source code (the invocation signature
to be precise). This does not feel okay. Can anyone give some pointers on
how to find parameter usage without resorting to parsing the source code (if
such a solution exists)?
(Googling didn't help so far, or I'm not using the right search parameters
;-)
Example Java source code, for which I want to follow the 'x' parameter:
void startPoint(String x, int y) {
// Here is first 'simple' parameter usage
this.doSomething(x, y);
// Here parameter is part of an expression
this.that.doAnother("[" + x + "]");
// Parameter is part of expression again (twice)
this.doLast(x.substring(0, y) + x.substring(y + 8));
}
Cheers,
Erik
--
Sent from: http://forum.world.st/Moose-f1310756.html
4 years, 5 months
Users of Phexample are trapped
by Stéphane Ducasse
We should pay attention to super vicious dependencies.
For example ConfigurationOfPhexample dependent on a new version of StateSpecs.
baseline21: spec
<version: '2.1-baseline'>
spec for: #'common' do: [
spec blessing: #'baseline'.
spec repository: 'http://www.smalltalkhub.com/mc/Phexample/Phexample/main'.
spec baseline: 'StateSpecs' with: [
spec repository: 'github://dionisiydk/StateSpecs:v2.4.x’].
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec package: 'Phexample' ].
Since this baseline is referring to github, it means that old users of Phexample
cannot load anymore their code. This is funny because they cannot load their code to
be able to fix it to load in recent pharo version.
So Alain cannot migrate his project because petitparser use Phexample.
Stef
--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr
http://www.synectique.eu / http://www.pharo.org
03 59 35 87 52
Assistant: Julie Jonas
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France
4 years, 6 months
Migrate PetitParser (1) on GitHub under moosetechnology organisation?
by Julien
Hello,
I’d like to migrate PetitParser (1) on GitHub under moosetechnology organisation.
I have a project depending on it and there are some stuff I’d like to fix on PetitParser 1 ConfigurationOf (which will become a baseline on GitHub).
Is it ok to migrate it?
Cheers,
Julien
---
Julien Delplanque
Doctorant à l’Université de Lille
http://juliendelplanque.be/phd.html
Equipe Rmod, Inria
Bâtiment B 40, Avenue Halley 59650 Villeneuve d'Ascq
Numéro de téléphone: +333 59 35 86 40
4 years, 6 months