anchor.diff:  			var/png = "data/paintings/[persistence_id]/[md5].png"
   			fdel(png)
   		for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
  -			if(P.C && md5(P.C.get_data_string()) == md5)
  -				QDEL_NULL(P.C)
  +			if(P.current_canvas && md5(P.current_canvas.get_data_string()) == md5)
  +				QDEL_NULL(P.current_canvas)
  +				P.update_icon()
  +				P.update_name_and_desc()
   		log_admin("[key_name(user)] has deleted a persistent painting made by [author].")
   		message_admins("<span class='notice'>[key_name_admin(user)] has deleted persistent painting made by [author].</span>")
  
positive.code: 
  /obj/structure/sign/painting
  	name = "Painting"
  	desc = "Art or \"Art\"? You decide. Use wirecutters to remove the painting."
  	icon = 'icons/obj/decals.dmi'
  	icon_state = "frame-empty"
  	custom_materials = list(/datum/material/wood = 2000)
  	buildable_sign = FALSE
  	var/obj/item/canvas/C
  	var/persistence_id
  
  /obj/structure/sign/painting/Initialize(mapload, dir, building)
  	. = ..()
  	SSpersistence.painting_frames += src
  	AddElement(/datum/element/art, OK_ART)
  	if(dir)
  		setDir(dir)
  	if(building)
  
negative.code: 	SSpersistence.painting_frames -= src
  
  /obj/structure/sign/painting/attackby(obj/item/I, mob/user, params)
  	if(!current_canvas && istype(I, /obj/item/canvas))
  		frame_canvas(user,I)
  	else if(current_canvas && current_canvas.painting_name == initial(current_canvas.painting_name) && istype(I,/obj/item/pen))
  		try_rename(user)
  	else
  		return ..()
  
  /obj/structure/sign/painting/examine(mob/user)
  	. = ..()
  	if(persistence_id)
  		. += "<span class='notice'>Any painting placed here will be archived at the end of the shift.</span>"
  	if(current_canvas)
  		current_canvas.ui_interact(user)
  		. += "<span class='notice'>Use wirecutters to remove the painting.</span>"
  
  /obj/structure/sign/painting/wirecutter_act(mob/living/user, obj/item/I)
  	. = ..()
  	if(current_canvas)
  		current_canvas.forceMove(drop_location())
  		current_canvas = null
  		to_chat(user, "<span class='notice'>You remove the painting from the frame.</span>")
  		update_icon()
  		update_name_and_desc()
  		return TRUE
  
  /obj/structure/sign/painting/proc/frame_canvas(mob/user,obj/item/canvas/new_canvas)
  	if(user.transferItemToLoc(new_canvas,src))
  		current_canvas = new_canvas
  		if(!current_canvas.finalized)
  			current_canvas.finalize(user)
  		to_chat(user,"<span class='notice'>You frame [current_canvas].</span>")
  	update_icon()
  	update_name_and_desc()
  
  /obj/structure/sign/painting/proc/try_rename(mob/user)
  	if(current_canvas.painting_name == initial(current_canvas.painting_name))
  		current_canvas.try_rename(user)
  
  /obj/structure/sign/painting/proc/update_name_and_desc()
  	if(current_canvas)
  		name = "painting - [current_canvas.painting_name]"
  		desc = desc_with_canvas
  	else
  		name = initial(name)
  		desc = initial(desc)
  
  /obj/structure/sign/painting/update_icon_state()
  	. = ..()
  	if(current_canvas?.generated_icon)
  		icon_state = "frame-overlay"
  	else
  		icon_state = "frame-empty"
  