From 59b47c712229f83fffc4ce164809cc970650e357 Mon Sep 17 00:00:00 2001 From: tslediter Date: Tue, 2 Jul 2024 14:44:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit æ›´æ–° --- designer/utslvcldesigner.tsf | 2 +- funcext/tvclib/utslvclstdctl.tsf | 5 ++++- funcext/tvclib/utvclgraphics.tsf | 32 +++++++++++++++++++++----------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/designer/utslvcldesigner.tsf b/designer/utslvcldesigner.tsf index 03a6cff..9dcd1ac 100644 --- a/designer/utslvcldesigner.tsf +++ b/designer/utslvcldesigner.tsf @@ -2075,7 +2075,7 @@ begin dcmpdir := getdesignerpath()+"dcmps"+ioFileseparator(); CreateDirWithFileName(dcmpdir+"1.txt"); osysdir := trim(sysgettsllibpath()); - if osysdir[length(osysdir)]<>";" then osysdir+=";"; + if osysdir and osysdir[length(osysdir)]<>";" then osysdir+=";"; g_orig_lib_path := osysdir+Getfuncextdir()+ioFileseparator()+";"; syssettsllibpath( dcmpdir+";"+g_orig_lib_path); ini := static getdesginerini(); diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index 8d5e22e..fe6f79d 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -2611,7 +2611,10 @@ type tcustomedit=class(TCustomControl) private function geteditrect();virtual; begin - return ClientRect; + r := ClientRect; + r[2]-=1; + r[3]-=1; + return r; end function getBorder(); begin diff --git a/funcext/tvclib/utvclgraphics.tsf b/funcext/tvclib/utvclgraphics.tsf index 58a8220..3975651 100644 --- a/funcext/tvclib/utvclgraphics.tsf +++ b/funcext/tvclib/utvclgraphics.tsf @@ -901,8 +901,8 @@ type tg_axes = class(tg_base) // cmd_zoom_inc: begin if not ifarray(pm) then return ; - p0 := pm["x"]; - p1 := pm["y"]; + p0 := pm["cvsx"]; + p1 := pm["cvsy"]; for i := 0 to 2 do begin a0 := fzoom_box[i,0]; @@ -3604,6 +3604,7 @@ type tg_Polyline = class(tg_graph) // function paint(cvs);override; //»æÍ¼ begin if tgc_on<> visible then return ; + tempbarw := 0; if clip_state=tgc_on then begin //cvs.axesclip(); @@ -3619,13 +3620,21 @@ type tg_Polyline = class(tg_graph) // begin cvs.axesunclip(); end - //echo tostn(bx); xys := array(); set_lineinfo_to_canvas(cvs); ys := array(); for i,v in fgraph_data do begin if not zoom_to_xyz(v[0],v[1],bx[2,0],x,y) then return ; + if not(tempbarw) and fbar_width>0 then ////////´¦ÀíbarµÄ¿í¶È/////// + begin + zoom_to_xyz((v[0]+fbar_width/2),v[1],bx[2,0],xtemp,ytemp); + xtemp-=x; + ytemp-=y; + tempbarw := array(); + tempbarw[0] := fbar_width*(xtemp)/(abs(xtemp)+abs(ytemp)); + tempbarw[1] := fbar_width*(ytemp)/(abs(xtemp)+abs(ytemp)); + end xys[i] := array(integer(x),integer(y)); case fpolyline_style of tgc_LS_bar,tgc_LS_barplot,tgc_LS_filled: @@ -3637,7 +3646,7 @@ type tg_Polyline = class(tg_graph) // end fline_points_in_canvas := xys; //zoom_to_xyz(0,0,0,x,y); - paint_lines(cvs,fpolyline_style,xys,fclosed,array("line_mode":line_mode,"bar_width":fbar_width,"color":lineinfo.color,"bkcolor":lineinfo.bkcolor,"xy0":ys)); + paint_lines(cvs,fpolyline_style,xys,fclosed,array("line_mode":line_mode,"bar_width":tempbarw,"color":lineinfo.color,"bkcolor":lineinfo.bkcolor,"xy0":ys)); mk := markinfo.clone(); if mark_mode=tgc_on and mk.size>2 then begin @@ -3669,7 +3678,7 @@ type tg_Polyline = class(tg_graph) // dis := ceil((rec[2]-rec[0])/5); xys := array((rec[0]+dis,y0),(rec[0]+4*dis,y0)); set_lineinfo_to_canvas(cvs); - paint_lines(cvs,tgc_LS_interpolated,xys,0,array("line_mode":line_mode,"bar_width":fbar_width,"color":lineinfo.color,"bkcolor":lineinfo.bkcolor)); + paint_lines(cvs,tgc_LS_interpolated,xys,0,array("line_mode":line_mode,"bar_width":array(fbar_width,0),"color":lineinfo.color,"bkcolor":lineinfo.bkcolor)); mk := markinfo.clone(); if mark_mode=tgc_on and mk.size>2 then begin @@ -4412,16 +4421,17 @@ begin end o.tgc_LS_bar: begin - b_w := integer(ifo["bar_width"]/2); + b_w_x := integer(ifo["bar_width"][0]/2); + b_w_y := integer(ifo["bar_width"][1]/2); cvs.brush.color := ifo["bkcolor"]; for i,v in xys do begin - if b_w>=1 then + if b_w_x>=1 or b_w_y>1 then begin - v1 := array(v[0]-b_w,v[1]); - v2 := array(v[0]+b_w,v[1]); - v3 := array(ifo["xy0",i,0]+b_w,ifo["xy0",i,1]); - v4 := array(ifo["xy0",i,0]-b_w,ifo["xy0",i,1]); + v1 := array(v[0]-b_w_x,v[1]-b_w_y); + v2 := array(v[0]+b_w_x,v[1]+b_w_y); + v3 := array(ifo["xy0",i,0]+b_w_x,ifo["xy0",i,1]+b_w_y); + v4 := array(ifo["xy0",i,0]-b_w_x,ifo["xy0",i,1]-b_w_y); cvs.draw_polygon().points(array(v1,v2,v3,v4)).draw(); end else begin