// Place a Box so that it either fills the given
// container, or is placed 1/3 from the upper left edge,
// depending on how much space is left.
167195
func (b *Box) SetNicePlacement(container *Box) {
	b.frame.X = container.inner.X
	b.frame.Y = container.inner.Y
	leftoverwidth := container.inner.W - b.frame.W
	leftoverheight := container.inner.H - b.frame.H
	if leftoverwidth > b.frame.W {
		b.frame.X += leftoverwidth / 3
	}
	if leftoverheight > b.frame.H {
		b.frame.Y += leftoverheight / 3
	}
}
593464
func (opt *Options) fillMissing() {
	if opt.PackageName == "" {
		opt.PackageName = "main"
	}
	if opt.VariableName == "" {
		opt.VariableName = "assets"
	}
	if opt.Filename == "" {
		opt.Filename = fmt.Sprintf("%s_vfsdata.go", strings.ToLower(opt.VariableName))
	}
	if opt.VariableComment == "" {
		opt.VariableComment = fmt.Sprintf("%s statically implements the virtual filesystem provided to vfsgen.", opt.VariableName)
	}
}
200971
func (s *Face) SetBoundingBox(v *BoundingBox) *Face {
	s.BoundingBox = v
	return s
}
551392
func (bc BoxCorners) Box() Box {
	return Box{
		Top:    util.Math.MinInt(bc.TopLeft.Y, bc.TopRight.Y),
		Left:   util.Math.MinInt(bc.TopLeft.X, bc.BottomLeft.X),
		Right:  util.Math.MaxInt(bc.TopRight.X, bc.BottomRight.X),
		Bottom: util.Math.MaxInt(bc.BottomLeft.Y, bc.BottomRight.Y),
	}
}
1310006
func NewBox() *Box {
	b := &Box{
		width:           15,
		height:          10,
		innerX:          -1, // Mark as uninitialized.
		backgroundColor: Styles.PrimitiveBackgroundColor,
		borderColor:     Styles.BorderColor,
		titleColor:      Styles.TitleColor,
		titleAlign:      AlignCenter,
	}
	b.focus = b
	return b
}
861946
func (s SandboxService) Put(id string) (box Sandbox, err error) {
	answer := make(map[string]bool)
	answer["is_completed"] = true
	body, err := JSONReader(answer)

	if id == "" {
		return box, fmt.Errorf("must supply sandbox id to PUT request.")
	}

	err = s.client.magicRequestDecoder("PUT", "/sandboxes/"+id, body, &box)
	return
}
71263
func Joined(a, b *Box) Box {
	var joined Box
	joined.Min = Min(&a.Min, &b.Min)
	joined.Max = Max(&a.Max, &b.Max)
	return joined
}
1196037
func (set *TreeSet) Insert(coord geom.Coord) bool {
	if set.stride == 0 {
		set.stride = set.layout.Stride()
	}
	if len(coord) < set.stride {
		panic(fmt.Sprintf("Coordinate inserted into tree does not have a sufficient number of points for the provided layout.  Length of Coord was %v but should have been %v", len(coord), set.stride))
	}
	tree, added := set.insertImpl(set.tree, coord)
	if added {
		set.tree = tree
		set.size++
	}

	return added
}
290549
func (s *ParseStack) Push(ast AST) {
	s.container[s.top] = ast
	s.top++
}
823546
func (b *Box) FillWithPercentageMargins(container *Box, horizmarginp float32, vertmarginp float32) {
	horizmargin := int(float32(container.inner.W) * horizmarginp)
	vertmargin := int(float32(container.inner.H) * vertmarginp)
	b.Fill(container)
	b.frame.X += horizmargin
	b.frame.Y += vertmargin
	b.frame.W -= horizmargin * 2
	b.frame.H -= vertmargin * 2
}
1288043
func (r *resolver) container() *block {
	for b := r.env; ; b = b.parent {
		if b.function != nil || b.isModule() {
			return b
		}
	}
}
645521
func (cli *Client) ContainerResize(ctx context.Context, containerID string, options types.ResizeOptions) error {
	return cli.resize(ctx, "/containers/"+containerID, options.Height, options.Width)
}
499046
func (t *ContainerVolumeTracker) Add(path string) {
	if _, ok := t.paths[path]; !ok {
		t.paths[path] = ""
	}
}
126898
func (s *CelebrityDetail) SetBoundingBox(v *BoundingBox) *CelebrityDetail {
	s.BoundingBox = v
	return s
}
888867
func (window *Window) SetPosition(x, y int32) {
	C.SDL_SetWindowPosition(window.cptr(), C.int(x), C.int(y))
}
912446
func (s *ComparedFace) SetBoundingBox(v *BoundingBox) *ComparedFace {
	s.BoundingBox = v
	return s
}
97456
func (s *Instance) SetBoundingBox(v *BoundingBox) *Instance {
	s.BoundingBox = v
	return s
}