mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fixes for small point rendering
This commit is contained in:
parent
9ac35805f9
commit
6257151e81
@ -116,11 +116,13 @@ make_geom(int bitmap_top, int bitmap_left, float advance, float poly_margin,
|
||||
float bottom = origin_y - tex_y_size / tex_pixels_per_unit - tex_poly_margin;
|
||||
float right = origin_x + tex_x_size / tex_pixels_per_unit + tex_poly_margin;
|
||||
|
||||
// And the corresponding corners in UV units.
|
||||
float uv_top = 1.0f - (float)(_y - poly_margin) / _page->get_y_size();
|
||||
float uv_left = (float)(_x - poly_margin) / _page->get_x_size();
|
||||
float uv_bottom = 1.0f - (float)(_y + poly_margin + tex_y_size) / _page->get_y_size();
|
||||
float uv_right = (float)(_x + poly_margin + tex_x_size) / _page->get_x_size();
|
||||
// And the corresponding corners in UV units. We add 0.5f to center
|
||||
// the UV in the middle of its texel, to minimize roundoff errors
|
||||
// when we are close to 1-to-1 pixel size.
|
||||
float uv_top = 1.0f - ((float)(_y - poly_margin) + 0.5f) / _page->get_y_size();
|
||||
float uv_left = ((float)(_x - poly_margin) + 0.5f) / _page->get_x_size();
|
||||
float uv_bottom = 1.0f - ((float)(_y + poly_margin + tex_y_size) + 0.5f) / _page->get_y_size();
|
||||
float uv_right = ((float)(_x + poly_margin + tex_x_size) + 0.5f) / _page->get_x_size();
|
||||
// Create a corresponding triangle pair. We use a pair of indexed
|
||||
// triangles rther than a single triangle strip, to avoid the bad
|
||||
// vertex duplication behavior with lots of two-triangle strips.
|
||||
|
@ -237,8 +237,7 @@ output(ostream &out) const {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void TextNode::
|
||||
write(ostream &out, int indent_level) const {
|
||||
indent(out, indent_level)
|
||||
<< "TextNode " << get_name() << "\n";
|
||||
PandaNode::write(out, indent_level);
|
||||
TextProperties::write(out, indent_level + 2);
|
||||
indent(out, indent_level + 2)
|
||||
<< "transform is: " << *TransformState::make_mat(_transform) << "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user