Commit cf43c474 authored by Martin Schreiber's avatar Martin Schreiber

* Handle do_nearstart in dragcontroller.

parent c9969019
......@@ -60,6 +60,8 @@ type
const
dragstates = [ds_clicked,ds_beginchecked,ds_haddragobject];
sdndexpiretime = 5000000; //5s
dragmindist = 4;
type
drageventsty = record
dragbegin: drageventty;
......@@ -326,7 +328,15 @@ begin
ek_buttonpress: begin
if checkclickstate(info) then begin
fpickpos:= info.pos;
fpickrect:= fintf.getdragrect(fpickpos);
if do_nearstart in foptions then begin
fpickrect.x:= info.pos.x - dragmindist;
fpickrect.y:= info.pos.y - dragmindist;
fpickrect.cx:= 2 * dragmindist;
fpickrect.cy:= 2 * dragmindist;
end
else begin
fpickrect:= fintf.getdragrect(fpickpos);
end;
include(fstate,ds_clicked);
end;
end;
......
......@@ -88,7 +88,6 @@ const
defaultgridskinoptions = [osk_framebuttononly];
sortglyphwidth = 11;
defaultwheelscrollheight = 0;
dragmindist = 4;
rowstatefoldleveltag = 0;
rowstateissumtag = 1;
......@@ -16525,20 +16524,12 @@ function tcustomgrid.getdragrect(const apos: pointty): rectty;
var
cell1: gridcoordty;
begin
if do_nearstart in fdragcontroller.options then begin
result.x:= apos.x - dragmindist;
result.y:= apos.y - dragmindist;
result.cx:= 2 * dragmindist;
result.cy:= 2 * dragmindist;
cell1:= cellatpos(apos);
if isdatacell(cell1) then begin
result:= cellrect(cell1);
end
else begin
cell1:= cellatpos(apos);
if isdatacell(cell1) then begin
result:= cellrect(cell1);
end
else begin
result:= inherited getdragrect(apos);
end;
result:= inherited getdragrect(apos);
end;
end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment