Re: Bug with get_size() / set_size() in Points?



El 19/06/12 13:17, Jiří Techet escribió:
> On Mon, Jun 18, 2012 at 2:35 PM, Pablo Castellano <pablo anche no> wrote:
>> Hi.
>>
>> I think I have found a bug with set_size() and get_size().
>>
>> They don't work as expected with Points.
>>
>> I want to use it in order to draw points smaller when the map is
>> zoomed-out. Getting the size of a point and then setting the size+1 or
>> size-1 to this point doesn't draw it well.
>> Instead, I get the expected behaviour by removing first the marker from
>> the layer and then adding a new one with different size.
>>
>> I have isolated this issue into a Python example. You can get it from my
>> libchamplain repo in github:
>> https://github.com/PabloCastellano/libchamplain/tree/pablog
>> https://github.com/PabloCastellano/libchamplain/blob/pablog/test2i.py
>>
>> I'm not very familiarized with Cairo/Clutter so I have no idea how to
>> fix it ;(
> 
> Hi Pablo,
> 
> first thanks for doing the boring stuff and going through the
> documentation and fixing various typos and copy/paste errors. Much
> appreciated! Your new project looks interesting too!
> 
> I've just had a quick look at the issue and you're right, this is a
> libchamplain bug. From looking at the code the problem seems to be
> that when you set the size, the size is only taken for cario drawing
> but the size of the clutter actor into which the point is drawn is not
> updated. So what happens is that the cario drawing is rescaled to the
> clutter actor size (so at size 1 you get a grey square). It should be
> pretty easy to fix - I'll have a look at it during the next weekend.
> 
> Thanks,
> 
> Jiri
> 

Awesome! Thanks a lot! :)

BTW I tried Tomaz's advice (using set_scale()) and it worked fine.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]