当前位置: 首页>>代码示例>>C++>>正文


C++ Allocation::y方法代码示例

本文整理汇总了C++中Allocation::y方法的典型用法代码示例。如果您正苦于以下问题:C++ Allocation::y方法的具体用法?C++ Allocation::y怎么用?C++ Allocation::y使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Allocation的用法示例。


在下文中一共展示了Allocation::y方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: damage

void XYView::damage(Glyph* g, const Allocation& a, bool fixed, bool vf) {
    if (canvas_) {
        Extension e;
        canvas_->push_transform();
        canvas_->transformer(((XYView_helper*)body())->t_);
        if (fixed) {
            Coord x, y;
            canvas_->transform(s2o());
            if (vf) {
                view_ratio(a.x(), a.y(), x, y);
            } else {
                s2o().inverse_transform(a.x(), a.y(), x, y);
            }
            Allocation a_fix = a;
            a_fix.x_allotment().origin(x);
            a_fix.y_allotment().origin(y);
            g->allocate(canvas_, a_fix, e);
        } else {
            g->allocate(canvas_, a, e);
        }
//printf("damage extension %g %g %g %g\n", e.left(), e.bottom(), e.right(), e.top());
//print_t("XYView::damage", canvas_->transformer());
        canvas_->pop_transform();
        canvas_->damage(e);
    }
}
开发者ID:vortexlaboratory,项目名称:neuron,代码行数:26,代码来源:xyview.cpp

示例2: allocate

void Character::allocate(Canvas* c, const Allocation& a, Extension& ext) {
    Coord x = a.x();
    Coord y = a.y();
    ext.set_xy(
	c, x - left_bearing_, y - descent_, x + right_bearing_, y + ascent_
    );
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:7,代码来源:character.c

示例3: Transformer

void Graphic31::draw(Canvas* c, const Allocation& a) const {
    if (c != nil) {
        boolean no_transformer = !_t;
        if (no_transformer) {
	  ((Graphic31*)this)->_t = new Transformer();
	  _t->Translate(a.x(), a.y());
	}
	Graphic31* gr = (Graphic31*) this;
        CanvasDamage& cd = c->rep()->damage_;
        gr->drawclipped(
            c, cd.left, cd.bottom, cd.right, cd.top
        );
	if (no_transformer) {
	  _t->Translate(-a.x(), -a.y());
	  delete _t;
	  ((Graphic31*)this)->_t = nil;
	}
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:19,代码来源:figure.c

示例4:

void Graphic31::allocate(Canvas* c, const Allocation& a, Extension& ext) {
    if (_ctrlpts > 0) {
        Coord w = _brush == nil ? 0 : _brush->width();
        Coord x = a.x();
        Coord y = a.y();
        ext.merge_xy(
            c, x + _xmin - w, x + _xmax + w,
            y + _ymin - w, y + _ymax + w
        );
    }
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:11,代码来源:figure.c

示例5: draw

void Space::draw(Canvas* c, const Allocation& a) const {
    if (count_ > 0) {
        Coord x = a.x();
        Coord y = a.y();
        Coord each = (a.right() - a.left()) / count_;
        for (int i = 0; i < count_; ++i) {
            c->character(font_, ' ', each, color_, x, y);
            x += each;
        }
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:11,代码来源:layout.c

示例6: transform

void TransformFitter::transform(
    Transformer& t, const Allocation& a, const Allocation& natural
) const {
    const Allotment& natural_x = natural.x_allotment();
    const Allotment& natural_y = natural.y_allotment();
    if (!Math::equal(natural_x.span(), Coord(0), float(1e-2)) &&
	!Math::equal(natural_y.span(), Coord(0), float(1e-2))
    ) {
	const Allotment& ax = a.x_allotment();
	const Allotment& ay = a.y_allotment();
	t.scale(
	    a.x_allotment().span() / natural_x.span(),
	    a.y_allotment().span() / natural_y.span()
	);
    }
    t.translate(a.x(), a.y());
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:17,代码来源:tformsetter.c

示例7: allocate

void Page::allocate(Canvas* c, const Allocation& allocation, Extension& ext) {
    canvas_ = c;
    allocation_ = allocation;
    if (background_ != nil) {
        background_->allocate(c, allocation, ext);
    }
    GlyphIndex count = info_->count();
    for (GlyphIndex index = 0; index < count; ++index) {
        PageInfo& info = info_->item_ref(index);
        if (info.glyph_ != nil) {
            Allocation& a = info.allocation_;
            Extension& b = info.extension_;
            Requisition s;
            info.glyph_->request(s);
            Allotment ax = Allotment(
                allocation.x() + info.x_,
                s.requirement(Dimension_X).natural(),
                s.requirement(Dimension_X).alignment()
            );
            Allotment ay = Allotment(
                allocation.y() + info.y_,
                s.requirement(Dimension_Y).natural(),
                s.requirement(Dimension_Y).alignment()
            );
            if (
                !(info.status_ & PageInfoAllocated)
                || !ax.equals(a.allotment(Dimension_X), epsilon)
                || !ay.equals(a.allotment(Dimension_Y), epsilon)
            ) {
                if (c != nil && (info.status_ & PageInfoExtended)) {
                    c->damage(b);
                }
                a.allot(Dimension_X, ax);
                a.allot(Dimension_Y, ay);
		b.clear();
                info.glyph_->allocate(c, a, b);
                if (c != nil) {
                    c->damage(b);
                }
            }
            info.status_ |= PageInfoAllocated|PageInfoExtended;
            ext.merge(b);
        }
    }
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:45,代码来源:page.c

示例8: draw

void Character::draw(Canvas* c, const Allocation& a) const {
    c->character(font_, c_, a.right() - a.left(), color_, a.x(), a.y());
}
开发者ID:LambdaCalculus379,项目名称:SLS-1.02,代码行数:3,代码来源:character.c


注:本文中的Allocation::y方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。