samples/limit/limit.js

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。


function limit_moving(win)
{
	if (win.Width == limitpoint_x2[win.limit]-limitpoint_x1[win.limit]) // full limit X
	{
		// here we overwrite the mouse and set our own coordinate to limit X moving
		WinLIKE_x=win.Left; 
		
		// here we limit also Y to the defined area
		if (WinLIKE_y < limitpoint_y1[win.limit]) // stop above
			WinLIKE_y=limitpoint_y1[win.limit];
		else if (!win.Mn && WinLIKE_y+win.Height >  limitpoint_y2[win.limit]) // stop bottom in normal mode
			WinLIKE_y= limitpoint_y2[win.limit]-win.Height;
		else if (win.Mn && WinLIKE_y >  limitpoint_y2[win.limit]-win.skinTitleHeight) // stop bottom if minimized
			WinLIKE_y= limitpoint_y2[win.limit]-win.skinTitleHeight;
	}
	else // full limit Y
	{
		// here we overwrite the mouse and set our own coordinate to limit Y moving
		WinLIKE_y=win.Top;
		
		// here we limit also X to the defined area
		if (WinLIKE_x < limitpoint_x1[win.limit]) // stop left
			WinLIKE_x=limitpoint_x1[win.limit];
		else if (WinLIKE_x+win.Width > limitpoint_x2[win.limit]) // stop right
			WinLIKE_x=limitpoint_x2[win.limit]-win.Width;
	}

	return true; // now go on WinLIKE and use the new values
}

function limit_resizing(win)
{
	if (win.Width == limitpoint_x2[win.limit]-limitpoint_x1[win.limit]) // full limit X resizing
		WinLIKE_x=win.Width; // here we overwrite the mouse and set our own coordinate			
	else // full limit Y resizing
		WinLIKE_y=win.Height; // here we overwrite the mouse and set our own coordinate			

	// here we limit also Y to the defined area
	if (WinLIKE_y+win.Top > limitpoint_y2[win.limit]) // stop bottom
		WinLIKE_y=limitpoint_y2[win.limit]-win.Top;

	// here we limit also X to the defined area
	if (WinLIKE_x+win.Left > limitpoint_x2[win.limit]) // stop right
		WinLIKE_x=limitpoint_x2[win.limit]-win.Left;

	return true; // now go on WinLIKE and use the new values
}

function limit_restore(win)
{
	// reset Top to the area maximum when window is restored from minimize status
	if (win.Top > limitpoint_y2[win.limit]-win.Height) // bottom
			win.Top=limitpoint_y2[win.limit]-win.Height;
	win.draw(); // redraw window in non minimized status
}

function limit_visual()
{
	// this function is only for visualization of the limit areas
后面还有 51 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。