The ruling from the state’s high court came four years after Oregon voters narrowly approved a suite of gun control measures, including the magazine limits.