Ruby GTK3移行後のメインリポジトリ
修訂 | 6c7a24b7e800cb69fd36a04279898e75b41c07c2 (tree) |
---|---|
時間 | 2015-03-12 23:52:19 |
作者 | Shyouzou Sugitani <shy@user...> |
Commiter | Shyouzou Sugitani |
update surface.rb
@@ -652,8 +652,8 @@ module Surface | ||
652 | 652 | x, y = get_position(side) |
653 | 653 | direction = @window[side].direction |
654 | 654 | ox, oy = get_balloon_offset(side) |
655 | - parent.handle_request( | |
656 | - 'NOTIFY', 'set_balloon_direction', side, direction) | |
655 | + @parent.handle_request( | |
656 | + 'NOTIFY', 'set_balloon_direction', side, direction) | |
657 | 657 | if direction == 0 # left |
658 | 658 | base_x = x + ox |
659 | 659 | else |
@@ -662,7 +662,7 @@ module Surface | ||
662 | 662 | end |
663 | 663 | base_y = y + oy |
664 | 664 | @parent.handle_request( |
665 | - 'NOTIFY', 'set_balloon_position', side, base_x, base_y) | |
665 | + 'NOTIFY', 'set_balloon_position', side, base_x, base_y) | |
666 | 666 | end |
667 | 667 | end |
668 | 668 |
@@ -1344,12 +1344,14 @@ module Surface | ||
1344 | 1344 | cr.move_to(x1 + 2, y1) |
1345 | 1345 | font_desc = Pango::FontDescription.new |
1346 | 1346 | font_desc.set_size(8 * Pango::SCALE) |
1347 | - layout = Pango::Layout.new(@darea.pango_context) | |
1347 | + layout = cr.create_pango_layout | |
1348 | +# layout = Pango::Layout.new(@darea.pango_context) | |
1348 | 1349 | layout.set_font_description(font_desc) |
1349 | 1350 | layout.set_wrap(Pango::WRAP_WORD_CHAR) # XXX |
1350 | - layout.set_text(part, -1) | |
1351 | - PangoCairo.update_layout(cr, layout) | |
1352 | - PangoCairo.show_layout(cr, layout) | |
1351 | + layout.set_text(part) | |
1352 | + cr.show_pango_layout(layout) | |
1353 | +# PangoCairo.update_layout(cr, layout) | |
1354 | +# PangoCairo.show_layout(cr, layout) | |
1353 | 1355 | end |
1354 | 1356 | cr.set_operator(Cairo::OPERATOR_ATOP) |
1355 | 1357 | cr.set_source_rgba(0.2, 0.0, 0.0, 0.4) # XXX |
@@ -1368,8 +1370,8 @@ module Surface | ||
1368 | 1370 | end |
1369 | 1371 | if @mayuna.include?(surface_id) and @mayuna[surface_id] |
1370 | 1372 | surface = get_image_surface(surface_id) |
1371 | - surface_width = surface.get_width() | |
1372 | - surface_height = surface.get_height() | |
1373 | + surface_width = surface.width | |
1374 | + surface_height = surface.height | |
1373 | 1375 | done = [] |
1374 | 1376 | for actor in @mayuna[surface_id] |
1375 | 1377 | actor_id = actor.get_id() |
@@ -1411,7 +1413,7 @@ module Surface | ||
1411 | 1413 | for surface_id, x, y, method in @seriko.iter_overlays() |
1412 | 1414 | begin |
1413 | 1415 | overlay_surface = get_image_surface( |
1414 | - surface_id, is_asis=bool(method == 'asis')) | |
1416 | + surface_id, is_asis=(method == 'asis')) | |
1415 | 1417 | rescue # except: |
1416 | 1418 | next |
1417 | 1419 | end |
@@ -1427,13 +1429,13 @@ module Surface | ||
1427 | 1429 | 'asis' => Cairo::OPERATOR_OVER, |
1428 | 1430 | }[method] |
1429 | 1431 | cr.set_operator(op) |
1430 | - cr.set_source_surface(overlay_surface, x, y) | |
1432 | + cr.set_source(overlay_surface, x, y) | |
1431 | 1433 | if ['overlay', 'overlayfast'].include?(method) |
1432 | - cr.mask_surface(overlay_surface, x, y) | |
1434 | + cr.mask(overlay_surface, x, y) | |
1433 | 1435 | else |
1434 | 1436 | cr.paint() |
1435 | 1437 | end |
1436 | - del cr | |
1438 | +# del cr | |
1437 | 1439 | end |
1438 | 1440 | @image_surface = new_surface |
1439 | 1441 | @darea.queue_draw() |