Recalculate Font on window resize
This commit is contained in:
+36
-5
@@ -2,7 +2,7 @@ package edit2d
|
||||
|
||||
import "core:fmt"
|
||||
import b2 "vendor:box2d"
|
||||
import im "shared:odin-imgui"
|
||||
//import im "shared:odin-imgui"
|
||||
import draw "./draw"
|
||||
|
||||
/*
|
||||
@@ -36,6 +36,7 @@ distance_joint_def :: struct
|
||||
using def : b2.DistanceJointDef,
|
||||
}
|
||||
|
||||
/*
|
||||
interface_edit_joint_common :: proc(joint_def : ^joint_common, interface: ^interface_state) -> bool
|
||||
{
|
||||
level := interface.world
|
||||
@@ -91,6 +92,30 @@ interface_edit_joint_common :: proc(joint_def : ^joint_common, interface: ^inter
|
||||
return ret
|
||||
}
|
||||
|
||||
mu_interface_edit_joint_common :: proc(joint_def : ^joint_common, interface: ^interface_state) -> bool
|
||||
{
|
||||
level := interface.world
|
||||
|
||||
{
|
||||
if joint_def.entity_a in level.static_indexes{
|
||||
entity_a := interface.entity_defs[level.static_indexes[joint_def.entity_a]]
|
||||
draw.points_add(&interface.state.draw.points, entity_a.body_def.position, 20.0, {200, 240, 200, 200})
|
||||
|
||||
}
|
||||
if joint_def.entity_b in level.static_indexes{
|
||||
entity_b := interface.entity_defs[level.static_indexes[joint_def.entity_b]]
|
||||
draw.points_add(&interface.state.draw.points, entity_b.body_def.position, 20.0, {200, 240, 200, 200})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ret := false
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
interface_edit_distance_joint :: proc( interface : ^interface_state ) -> bool
|
||||
{
|
||||
@@ -271,13 +296,19 @@ interface_joints :: proc(interface: ^interface_state) -> bool
|
||||
ret := false
|
||||
//interface.edit_mode = .JOINT
|
||||
|
||||
if im.BeginCombo("Joint type", fmt.ctprint(interface.curr_joint_type))
|
||||
ctx := &interface.state.mu_ctx
|
||||
|
||||
if .ACTIVE in mu.begin_treenode(ctx, "Joint Type")
|
||||
{
|
||||
for type in b2.JointType
|
||||
{
|
||||
if im.Selectable(fmt.ctprint(type), type == interface.curr_joint_type) do interface.curr_joint_type = type
|
||||
state := interface.curr_joint_type == type
|
||||
if .CHANGE in mu.checkbox(ctx, fmt.tprint(type), &state)
|
||||
{
|
||||
interface.curr_joint_type = type
|
||||
}
|
||||
}
|
||||
im.EndCombo()
|
||||
mu.end_treenode(ctx)
|
||||
}
|
||||
|
||||
|
||||
@@ -291,4 +322,4 @@ interface_joints :: proc(interface: ^interface_state) -> bool
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user