feat: add shape transforms
This commit is contained in:
@@ -140,19 +140,20 @@ static gboolean render(GtkGLArea* a, GdkGLContext* ctx,
|
||||
vb.count = 0;
|
||||
|
||||
vektor_rasterize(&vb, renderInfo->shapes, renderInfo->zoom);
|
||||
size_t shape_vertex_count = vb.count; // remember how many vertices belong to shapes
|
||||
size_t shape_vertex_count =
|
||||
vb.count; // remember how many vertices belong to shapes
|
||||
|
||||
|
||||
if (renderInfo->selectedShape != NULL &&
|
||||
*(renderInfo->selectedShape) != NULL) {
|
||||
|
||||
VektorShape* selectedShape = *renderInfo->selectedShape;
|
||||
|
||||
// create handle quads if a shape is selected
|
||||
for(size_t i = 0; i < selectedShape->handleCount; i++) {
|
||||
for (size_t i = 0; i < selectedShape->handleCount; i++) {
|
||||
V2 handle = selectedShape->handles[i];
|
||||
VektorBBox handleBbox = vektor_bbox_fromcenter(handle, 0.01f);
|
||||
vektor_vb_add_quad(&vb, handleBbox.min, handleBbox.max, vektor_color_new(255, 255, 255, 255));
|
||||
vektor_vb_add_quad(&vb, handleBbox.min, handleBbox.max,
|
||||
vektor_color_new(255, 255, 255, 255));
|
||||
}
|
||||
|
||||
shape_vertex_count = vb.count;
|
||||
@@ -164,12 +165,8 @@ static gboolean render(GtkGLArea* a, GdkGLContext* ctx,
|
||||
|
||||
vektor_vb_add_quad(&vb, bbox.min, bbox.max,
|
||||
vektor_color_new(255, 255, 255, 255));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
glBufferData(GL_ARRAY_BUFFER, vb.count * sizeof(Vertex), vb.vertices,
|
||||
GL_STATIC_DRAW);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user