프로젝트

일반

사용자정보

개정판 6d011c3c

ID6d011c3c1b1baaaa5778b051ffef6b5bcb7dfeac
상위 115ef24c
하위 8bfdce15

함의성이(가) 약 5년 전에 추가함

issue #563: owner find fix

Change-Id: I056ab0780a57691fb32a135c8b05fc10918799c9

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringInstrumentItem.py
187 187
            ratio = float(configs[0].value) if 1 == len(configs) else 1.5
188 188

  
189 189
            dist = (self.sceneBoundingRect().height() + self.sceneBoundingRect().width()) * ratio / 2
190
            center = self.sceneBoundingRect().center()
190
            center = [self.origin[0], self.origin[1]]
191 191

  
192 192
            for attr in attributes:
193 193
                if issubclass(type(attr), QEngineeringTextItem):
......
196 196
                            attr.owner = self  # set owner of text
197 197

  
198 198
                elif issubclass(type(attr), SymbolSvgItem) and attr is not self:
199
                    dx = attr.center().x() - center.x()
200
                    dy = attr.center().y() - center.y()
199
                    dx = attr.origin[0] - center[0]
200
                    dy = attr.origin[1] - center[1]
201 201

  
202
                    offset = (attr.sceneBoundingRect().width() + attr.sceneBoundingRect().height()) / 4
203
                    length = math.sqrt(dx * dx + dy * dy) - offset
202
                    length = math.sqrt(dx * dx + dy * dy)
204 203

  
205 204
                    if (length < dist) and (minDist is None or length < minDist):
206 205
                        minDist = length
DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
737 737
                    dx = symbol.origin[0] - center.x()
738 738
                    dy = symbol.origin[1] - center.y()
739 739

  
740
                    offset = (symbol.sceneBoundingRect().width() + symbol.sceneBoundingRect().height()) / 4
741
                    length = math.sqrt(dx * dx + dy * dy) - offset
740
                    #offset = (symbol.sceneBoundingRect().width() + symbol.sceneBoundingRect().height()) / 4
741
                    length = math.sqrt(dx * dx + dy * dy)# - offset
742 742

  
743 743
                    if (length < dist) and (minDist is None or length < minDist):
744 744
                        minDist = length
DTI_PID/DTI_PID/Shapes/EngineeringValveOperCodeTextItem.py
50 50

  
51 51
            for symbol in symbols:
52 52
                if type(symbol) is SymbolSvgItem or type(symbol) is QEngineeringInstrumentItem:                    
53
                    dx = symbol.center().x() - center.x()
54
                    dy = symbol.center().y() - center.y()            
53
                    dx = symbol.origin[0] - center.x()
54
                    dy = symbol.origin[1] - center.y()            
55 55

  
56
                    offset = (symbol.sceneBoundingRect().width() + symbol.sceneBoundingRect().height()) / 4
57
                    length = math.sqrt(dx*dx + dy*dy) - offset
56
                    #offset = (symbol.sceneBoundingRect().width() + symbol.sceneBoundingRect().height()) / 4
57
                    length = math.sqrt(dx*dx + dy*dy)# - offset
58 58
                    
59 59
                    if (length < dist) and (minDist is None or length < minDist):
60 60
                        minDist = length

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)