Drag Image of LayoutPanel is terrible... can I do something with this!?

34 views
Skip to first unread message

Michał Huszcza

unread,
Jul 16, 2012, 4:36:58 PM7/16/12
to google-we...@googlegroups.com
Hello,
When I set:
                final LayoutPanel layoutPanel = new LayoutPanel();
                layoutPanel.add(new Label("Drag Widget"));
                layoutPanel.setHeight("50px");
                layoutPanel.getElement().setDraggable(Element.DRAGGABLE_TRUE);

                layoutPanel.addDomHandler(new DragStartHandler() {
                        @Override
                        public void onDragStart(DragStartEvent event) {
                                event.setData("text", "Hello World");
                                event.getDataTransfer().setDragImage(layoutPanel.getElement(), 10, 10);
                        }
                }, DragStartEvent.getType());
(...)
and then, when I'm really dragging this simple widget it don't has mouse pointer at it's 10x10px image coordinates, but this widget's image is deep under mouse pointer and is gradiently opacity... looks bad.
When I use AbsolutePanel in place of LayoutPanel then "dragging help image" looks all right - with constant opacity and with mouse pointer at 10x10px.
Why?
Please help,
Thanks!
Reply all
Reply to author
Forward
0 new messages