[Libpapyrus-users] Groups do not work right as References?
Status: Beta
Brought to you by:
rvinyard
|
From: Julius Z. <zi...@mr...> - 2009-05-13 21:05:41
|
Hello Rick,
I came upon a problem with groups used by "Reference". In the small
example below, I put a rectangle inside a group (rect_group) and applied
some transformation to the group, including a 45 degree rotation. Then,
I build a Reference object that references rect_group. I shifted the
reference object 50 px right to see something. Apparently, the
transformations in rect_group got lost in the Reference (the "clone" is
not rotated by 45 degree, and not shifted downwards. But it should.
Should it?).
If I apply transformations directly on the rectangle (rect->set_xy(...))
everything works ok.
Could you please have a look?
Thanks!
Julius
//
#include <gtkmm.h>
#include <papyrus-gtkmm.h>
int main( int argc, char** argv )
{
Gtk::Main gtk_kit( argc, argv );
Gtk::Window window;
Papyrus::Gtk::Viewport viewport;
window.add( viewport );
window.show_all();
Papyrus::Group::pointer rect_group = Papyrus::Group::create();
Papyrus::Rectangle::pointer rect = Papyrus::Rectangle::create( 0, 0,
40, 5, Papyrus::RGBA( 0, 0, 1, .5 ) );
Papyrus::Group::pointer extra_group = Papyrus::Group::create();
extra_group->add( rect_group );
rect_group->add( rect );
rect_group->set_xy( -50, 30 );
rect_group->set_rotation( 0.25*M_PI );
viewport.canvas()->add( extra_group );
Papyrus::Reference::pointer reference = Papyrus::Reference::create(
rect_group );
reference->set_xy( 50, 0 );
viewport.canvas()->add( reference );
Gtk::Main::run( window );
}
|