Code review comment for lp:~uriboni/unity/unity-drag-shadow

Revision history for this message
Marco Trevisan (TreviƱo) (3v1n0) wrote :

Thanks for the branch, however it simply does not work as expected here: when I drag an icon out from the launcher, I get nothing painted on the screen, but one small pixel.
The problems seems to be in
SetBaseSize(DROP_SHADOW_SIZE * widthFactor, DROP_SHADOW_SIZE * heightFactor);

Also:
31 + glib::Error error;
32 + glib::Object<GdkPixbuf> pbuf(gdk_pixbuf_new_from_file_at_size(PKGDATADIR "/ordering_shadow.png",
33 + DROP_SHADOW_SIZE, DROP_SHADOW_SIZE, &error));

Since you don't LOG_ERROR the error, you can avoid to use it... Just pass nullptr to gdk_pixbuf_new_from_file_at_size

Also, instead of adding a new pixbuf, what about using the PKGDATADIR"/launcher_icon_shadow_200.png" or PKGDATADIR"/launcher_icon_shadow_62.png" textures that the AbstractIconRender is alredy using? So they will always match...

34 + if (GDK_IS_PIXBUF(pbuf.RawPtr()))

Use the nwe pbuf.IsType(GDK_TYPE_PIXBUF)

+ nux::BaseTexture* texture = nux::CreateTexture2DFromPixbuf(pbuf, true);

This should be unreferenced... You can just use a nux::ObjectPtr to handle it and forget.

PS: instead of checking != nullptr we prefer to have simple (check) or (!check) ;)

review: Needs Fixing

« Back to merge proposal