| | |
| | | var target1 = new(Target) |
| | | target1.TargetId = target.Id |
| | | target1.TargetScore = target.Score |
| | | target1.TargetType = target.Type |
| | | target1.TargetType = "action" |
| | | target1.TargetLocation = Points{TopLeft: Point{target.Location.X, target.Location.Y}, BottomRight: Point{target.Location.X + target.Location.Width, target.Location.Y + target.Location.Height}} |
| | | targetInfos = append(targetInfos, *target1) |
| | | } |
| | |
| | | var target1 = new(Target) |
| | | target1.TargetId = target.Id |
| | | target1.TargetScore = target.Score |
| | | target1.TargetType = target.Type |
| | | target1.TargetType = "action" |
| | | target1.TargetLocation = Points{TopLeft: Point{target.Location.X, target.Location.Y}, BottomRight: Point{target.Location.X + target.Location.Width, target.Location.Y + target.Location.Height}} |
| | | targetInfos = append(targetInfos, *target1) |
| | | } |
| | |
| | | } |
| | | |
| | | // 每边各扩百分之20 |
| | | func EnlargeSizeForCar(x0, y0, x1, y1 int, i protomsg.Image) (x0_new, y0_new, x1_new, y1_new int) { |
| | | func EnlargeSizeForCar(x0, y0, x1, y1 int, i protomsg.Image) (int,int,int,int) { |
| | | |
| | | // 先把长宽变为一比一 |
| | | chazhi := (y1 - y0) - (x1 - x0) |
| | |
| | | if x1 > int(i.Width) { |
| | | x1 = int(i.Width) |
| | | } |
| | | return |
| | | return x0, y0, x1, y1 |
| | | } |