@@ -297,6 +297,7 @@ def set_rotation_mode(self, m):
297
297
self ._rotation_mode = m
298
298
else :
299
299
raise ValueError ("Unknown rotation_mode : %s" % repr (m ))
300
+ self .stale = True
300
301
301
302
def get_rotation_mode (self ):
302
303
"get text rotation mode"
@@ -313,6 +314,7 @@ def update_from(self, other):
313
314
self ._rotation = other ._rotation
314
315
self ._picker = other ._picker
315
316
self ._linespacing = other ._linespacing
317
+ self .stale = True
316
318
317
319
def _get_layout (self , renderer ):
318
320
"""
@@ -786,6 +788,7 @@ def draw(self, renderer):
786
788
787
789
gc .restore ()
788
790
renderer .close_group ('text' )
791
+ self .stale = False
789
792
790
793
def get_color (self ):
791
794
"Return the color of the text"
@@ -963,6 +966,7 @@ def set_backgroundcolor(self, color):
963
966
self ._bbox .update (dict (facecolor = color ))
964
967
965
968
self ._update_clip_properties ()
969
+ self .stale = True
966
970
967
971
def set_color (self , color ):
968
972
"""
@@ -976,6 +980,7 @@ def set_color(self, color):
976
980
except TypeError :
977
981
color = tuple (color )
978
982
self ._color = color
983
+ self .stale = True
979
984
980
985
def set_ha (self , align ):
981
986
'alias for set_horizontalalignment'
@@ -992,6 +997,7 @@ def set_horizontalalignment(self, align):
992
997
raise ValueError ('Horizontal alignment must be one of %s' %
993
998
str (legal ))
994
999
self ._horizontalalignment = align
1000
+ self .stale = True
995
1001
996
1002
def set_ma (self , align ):
997
1003
'alias for set_verticalalignment'
@@ -1011,6 +1017,7 @@ def set_multialignment(self, align):
1011
1017
raise ValueError ('Horizontal alignment must be one of %s' %
1012
1018
str (legal ))
1013
1019
self ._multialignment = align
1020
+ self .stale = True
1014
1021
1015
1022
def set_linespacing (self , spacing ):
1016
1023
"""
@@ -1020,6 +1027,7 @@ def set_linespacing(self, spacing):
1020
1027
ACCEPTS: float (multiple of font size)
1021
1028
"""
1022
1029
self ._linespacing = spacing
1030
+ self .stale = True
1023
1031
1024
1032
def set_family (self , fontname ):
1025
1033
"""
@@ -1033,6 +1041,7 @@ def set_family(self, fontname):
1033
1041
'monospace' ]
1034
1042
"""
1035
1043
self ._fontproperties .set_family (fontname )
1044
+ self .stale = True
1036
1045
1037
1046
def set_variant (self , variant ):
1038
1047
"""
@@ -1041,6 +1050,7 @@ def set_variant(self, variant):
1041
1050
ACCEPTS: [ 'normal' | 'small-caps' ]
1042
1051
"""
1043
1052
self ._fontproperties .set_variant (variant )
1053
+ self .stale = True
1044
1054
1045
1055
def set_fontvariant (self , variant ):
1046
1056
'alias for set_variant'
@@ -1061,6 +1071,7 @@ def set_style(self, fontstyle):
1061
1071
ACCEPTS: [ 'normal' | 'italic' | 'oblique']
1062
1072
"""
1063
1073
self ._fontproperties .set_style (fontstyle )
1074
+ self .stale = True
1064
1075
1065
1076
def set_fontstyle (self , fontstyle ):
1066
1077
'alias for set_style'
@@ -1075,6 +1086,7 @@ def set_size(self, fontsize):
1075
1086
'medium' | 'large' | 'x-large' | 'xx-large' ]
1076
1087
"""
1077
1088
self ._fontproperties .set_size (fontsize )
1089
+ self .stale = True
1078
1090
1079
1091
def set_fontsize (self , fontsize ):
1080
1092
'alias for set_size'
@@ -1090,6 +1102,7 @@ def set_weight(self, weight):
1090
1102
'extra bold' | 'black' ]
1091
1103
"""
1092
1104
self ._fontproperties .set_weight (weight )
1105
+ self .stale = True
1093
1106
1094
1107
def set_fontweight (self , weight ):
1095
1108
'alias for set_weight'
@@ -1105,6 +1118,7 @@ def set_stretch(self, stretch):
1105
1118
'ultra-expanded' ]
1106
1119
"""
1107
1120
self ._fontproperties .set_stretch (stretch )
1121
+ self .stale = True
1108
1122
1109
1123
def set_fontstretch (self , stretch ):
1110
1124
'alias for set_stretch'
@@ -1126,6 +1140,7 @@ def set_x(self, x):
1126
1140
ACCEPTS: float
1127
1141
"""
1128
1142
self ._x = x
1143
+ self .stale = True
1129
1144
1130
1145
def set_y (self , y ):
1131
1146
"""
@@ -1134,6 +1149,7 @@ def set_y(self, y):
1134
1149
ACCEPTS: float
1135
1150
"""
1136
1151
self ._y = y
1152
+ self .stale = True
1137
1153
1138
1154
def set_rotation (self , s ):
1139
1155
"""
@@ -1142,6 +1158,7 @@ def set_rotation(self, s):
1142
1158
ACCEPTS: [ angle in degrees | 'vertical' | 'horizontal' ]
1143
1159
"""
1144
1160
self ._rotation = s
1161
+ self .stale = True
1145
1162
1146
1163
def set_va (self , align ):
1147
1164
'alias for set_verticalalignment'
@@ -1159,6 +1176,7 @@ def set_verticalalignment(self, align):
1159
1176
str (legal ))
1160
1177
1161
1178
self ._verticalalignment = align
1179
+ self .stale = True
1162
1180
1163
1181
def set_text (self , s ):
1164
1182
"""
@@ -1169,6 +1187,7 @@ def set_text(self, s):
1169
1187
ACCEPTS: string or anything printable with '%s' conversion.
1170
1188
"""
1171
1189
self ._text = '%s' % (s ,)
1190
+ self .stale = True
1172
1191
1173
1192
@staticmethod
1174
1193
def is_math_text (s ):
@@ -1201,6 +1220,7 @@ def set_fontproperties(self, fp):
1201
1220
if is_string_like (fp ):
1202
1221
fp = FontProperties (fp )
1203
1222
self ._fontproperties = fp .copy ()
1223
+ self .stale = True
1204
1224
1205
1225
def set_font_properties (self , fp ):
1206
1226
'alias for set_fontproperties'
@@ -1217,6 +1237,7 @@ def set_usetex(self, usetex):
1217
1237
self ._usetex = None
1218
1238
else :
1219
1239
self ._usetex = bool (usetex )
1240
+ self .stale = True
1220
1241
1221
1242
def get_usetex (self ):
1222
1243
"""
0 commit comments