feat(experimental): add selection tool
This commit is contained in:
@@ -50,14 +50,16 @@ void vektor_uictrl_init(GtkApplication* app, VektorWidgetState* stateOut) {
|
||||
GTK_BUTTON(gtk_builder_get_object(builder, "button_shapetools"));
|
||||
stateOut->workspaceRevealerShapes =
|
||||
GTK_REVEALER(gtk_builder_get_object(builder, "shape_revealer"));
|
||||
stateOut->workspaceButtonLinetool =
|
||||
stateOut->workspaceButtonLineTool =
|
||||
GTK_BUTTON(gtk_builder_get_object(builder, "button_linetool"));
|
||||
stateOut->workspaceButtonRecttool =
|
||||
stateOut->workspaceButtonRectTool =
|
||||
GTK_BUTTON(gtk_builder_get_object(builder, "button_rectangletool"));
|
||||
stateOut->workspaceButtonCircletool =
|
||||
stateOut->workspaceButtonCircleTool =
|
||||
GTK_BUTTON(gtk_builder_get_object(builder, "button_circletool"));
|
||||
stateOut->workspaceButtonPolygontool =
|
||||
stateOut->workspaceButtonPolygonTool =
|
||||
GTK_BUTTON(gtk_builder_get_object(builder, "button_polygontool"));
|
||||
stateOut->workspaceButtonSelectionTool =
|
||||
GTK_BUTTON(gtk_builder_get_object(builder, "button_selecttool"));
|
||||
stateOut->workspaceColorPicker =
|
||||
VEKTOR_COLOR_WHEEL(gtk_builder_get_object(builder, "color_picker"));
|
||||
|
||||
|
||||
@@ -17,10 +17,11 @@ typedef struct VektorWidgetState {
|
||||
|
||||
GtkButton* workspaceButtonMasterShapes;
|
||||
GtkRevealer* workspaceRevealerShapes;
|
||||
GtkButton* workspaceButtonLinetool;
|
||||
GtkButton* workspaceButtonRecttool;
|
||||
GtkButton* workspaceButtonCircletool;
|
||||
GtkButton* workspaceButtonPolygontool;
|
||||
GtkButton* workspaceButtonLineTool;
|
||||
GtkButton* workspaceButtonRectTool;
|
||||
GtkButton* workspaceButtonCircleTool;
|
||||
GtkButton* workspaceButtonPolygonTool;
|
||||
GtkButton* workspaceButtonSelectionTool;
|
||||
|
||||
VektorColorWheel* workspaceColorPicker;
|
||||
|
||||
|
||||
@@ -138,8 +138,6 @@ static gboolean render(GtkGLArea* a, GdkGLContext* ctx, VektorCanvasRenderInfo*
|
||||
VektorBBox bbox = vektor_primitive_get_bbox(
|
||||
(*(renderInfo->selectedShape))->primitive
|
||||
);
|
||||
|
||||
g_print("min: %f %f max: %f %f\n", bbox.min.x, bbox.min.y, bbox.max.x, bbox.max.y);
|
||||
|
||||
vektor_vb_add_quad(
|
||||
&vb,
|
||||
@@ -184,8 +182,8 @@ static gboolean render(GtkGLArea* a, GdkGLContext* ctx, VektorCanvasRenderInfo*
|
||||
|
||||
glUniformMatrix4fv(shader_selection_uProjMatrixLoc, 1, GL_FALSE, projectionMatrix);
|
||||
glUniform1f(shader_selection_uTimeLoc, time);
|
||||
glUniform2f(shader_selection_uMinLoc, bbox.min.x, bbox.min.y); // ← this was missing/broken
|
||||
glUniform2f(shader_selection_uMaxLoc, bbox.max.x, bbox.max.y); // ← this was missing/broken
|
||||
glUniform2f(shader_selection_uMinLoc, bbox.min.x, bbox.min.y);
|
||||
glUniform2f(shader_selection_uMaxLoc, bbox.max.x, bbox.max.y);
|
||||
glUniform4f(shader_selection_uC1Loc, 0, 0, 0, 1);
|
||||
glUniform4f(shader_selection_uC2Loc, 0.46, 0.46, 1, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user