本文整理汇总了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);
}
}
示例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_
);
}
示例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;
}
}
}
示例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
);
}
}
示例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;
}
}
}
示例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());
}
示例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);
}
}
}
示例8: draw
void Character::draw(Canvas* c, const Allocation& a) const {
c->character(font_, c_, a.right() - a.left(), color_, a.x(), a.y());
}