我正在尝试编写一个C++程序,它从用户那里获取以下输入来构造矩形(2到5之间):高度,宽度,x-pos,y-pos.所有这些矩形将平行于x轴和y轴存在,即它们的所有边都将具有0或无穷大的斜率.
我试图实现这个问题中提到的但我没有太多运气.
我目前的实现如下:
// Gets all the vertices for Rectangle 1 and stores them in an array -> arrRect1
// point 1 x: arrRect1[0], point 1 y: arrRect1[1] and so on...
// Gets all the vertices for Rectangle 2 and stores them in an array -> arrRect2
// rotated edge of point a, rect 1
int rot_x, rot_y;
rot_x = -arrRect1[3];
rot_y = arrRect1[2];
// point on rotated edge
int pnt_x, pnt_y;
pnt_x = arrRect1[2];
pnt_y = arrRect1[3]; …Run Code Online (Sandbox Code Playgroud) 了解这一点的最好方法是看看这个小提琴.
注意鼠标滚轮在红色框中的固定内容上的效果如何.我想滚动的可滚动div.
如果小提琴死了 - 基本上我有一个可滚动的div,上面有固定元素.通常,当鼠标滚过可滚动的div时,它当然会滚动.但是如果你超过了固定元素,那么就不会发生滚动.根据您的站点布局,这可能对用户来说是直观的.
jQuery解决方案没问题.
algorithm ×1
c++ ×1
geometry ×1
javascript ×1
jquery ×1
mousewheel ×1
overlap ×1
rectangles ×1